All pastes #474036 Raw Edit

Mine

public c v1 · immutable
·published 2007-05-06 15:56 UTC
rendered paste body
int check_malformed_ip(char* string) {	int pointcount = 0;	char* p;	int i;		for(i = 0, p = string; p != '\0'; p++, i++) {		if( *p < '0' && *p > '9' && *p != '.' && pointcount > 2){			return -1;		}		if(*p == '.' && i < 3){			pointcount++;			i = 0;		} else if(*p == '.' && i > 2) {			return -1;		}	}	return 1;	}