[Freeswitch-dev] Windows Compile Revision 8792

Bob Coleman bobc at devassert.com
Tue Jun 10 18:06:19 EDT 2008


Hi,

Had a problem compiling the latest this morning with switch_channel.c

[Line 1753]
if (offset >= 0) {
	if (offset > strlen(sub_val)) {
		*sub_val = '\0';
	} else {
		sub_val += offset;
	}
} else if ((size_t) abs(offset) <= strlen(sub_val)) {
	sub_val = cloned_sub_val + (strlen(cloned_sub_val) + offset);
}


Changed to:

if (offset >= 0) {
	if ((size_t)offset > strlen(sub_val)) {
		*sub_val = '\0';
	} else {
		sub_val += offset;
	}
} else if ((size_t) abs(offset) <= strlen(sub_val)) {
	sub_val = cloned_sub_val + (strlen(cloned_sub_val) + offset);
}

Basically added a cast to (size_t) for the second if. Wasnt too sure
whether I needed to remove negatives like the else if lower down.

Bob



More information about the Freeswitch-dev mailing list