All pastes #911326 Raw Edit

uthash infinite loop

public c v1 · immutable
·published 2008-02-20 17:15 UTC
rendered paste body
struct logline *hashtable = NULL;void analyze(struct logline *line) {	struct logline *s = NULL;	if (strstr(line->request,"liveinternet.ru")) {		HASH_FIND(hh, hashtable, &(line->userid),sizeof(long int), s);		if (s == NULL) {			HASH_ADD(hh, hashtable, userid, sizeof(long int), line);		}	}}int getresult(void){	struct logline *s;	int count = 0;	for (s=hashtable; s != NULL; s=s->hh.next) {		count++;	};	return count;};