if (end) endi = atoi(end);
if (end) { endi = atoi(end); }
int parsePortPattern(char* s, FieldData** fdata, FieldLength* length) {	char buf[256];		char* p = s;		*length = 0;	*fdata = 0;	char* pair;	while ((pair = get_next_token(&p, ","))) {		strncpy(buf, pair, sizeof(buf));		char* p2 = buf;		char* start = get_next_token(&p2, ":");		char* end = get_next_token(&p2, ",");		*length = *length + 4;		*fdata = realloc(*fdata, *length);		uint16_t starti = atoi(start);		uint16_t endi = starti;		if (end) endi = atoi(end);						(*fdata)[*length-4] = ((starti >> 8) & 0xFF);		(*fdata)[*length-3] = ((starti >> 0) & 0xFF);		(*fdata)[*length-2] = ((endi >> 8) & 0xFF);		(*fdata)[*length-1] = ((endi >> 0) & 0xFF);		}		return 0;	}