Hello,
Does somebody know what is happening here? This piece of code should skip leading spaces (and others).
If isspace encounters a non space character, it doesn't return false.
If we analyze the " isspace(*cs_str);" in the debugger, it returns 0. If we check the value in b_space after assigning the value, the value is <> 0. We are using an UTF-8 encoded string. Could that have anything to do with it? It confuses the hell out of us.
const char* glb_strnskip_leading(const char* cs_str, size_t ul_size)
{
size_t ul_idx = 0;
int b_space = 0;
while((ul_idx < ul_size))
{
b_space = isspace(*cs_str);
if ( ! b_space )
{
break;
}
else
{
++cs_str;
++ul_idx;
}
}
...
I hope anyone has a clue what is happening here
Miriam