Topic: [BUG] Trim functions in es_server.c to hungry
Hi,
I don't know if this has been already reported but I found a bug
in the server side source es_server.c which is still in the SVN too.
The *trim function also trims any chars with a code > 128. As you
may can think of, this is a signed/unsigned bug.
And as a bonus to prove matricks opinion false about modders ,
I'll post the patched functions here:
static const char *
str_ltrim(
const char *str_a )
{
const unsigned char *str_b = (const unsigned char *)str_a;
while ( *str_b && *str_b <= 32 )
str_b++;
return (const char *)str_b;
}
static void
str_rtrim(
char *str_a )
{
unsigned char *str_b = (unsigned char *)str_a + strlen( str_a );
while ( *(--str_b) <= 32 )
;
*(str_b + 1) = '\0';
}