C
cerr
Hi There,
I'm experiencing a weird problem with atoi and i'm looking for a
solution asap.
Okay, what I have in my code:
prs_log(LOG_NOTICE,"DEBUG: tmp:%s strlen:%d tmp[0]:%c tmp[1]:%c",tmp,
strlen(tmp), tmp[0], tmp[1]);
seq == atoi(tmp); //seq
prs_log(LOG_NOTICE,"DEBUG: parsed seq:%d",seq);
the prs_log function writes the message to syslog-ng.
Okay, now the output i'm getting looks like this:
DEBUG: tmp:51 strlen:2 tmp[0]:5 tmp[1]:1
DEBUG: parsed seq:0
What's going on here? I don't understand...
i did the strlen thingy
in the first string to see if there's any unprintable characters or
similar in my string...
I'm stuck, any help or tip is appreciated!
Thank you!
Ron
I'm experiencing a weird problem with atoi and i'm looking for a
solution asap.
Okay, what I have in my code:
prs_log(LOG_NOTICE,"DEBUG: tmp:%s strlen:%d tmp[0]:%c tmp[1]:%c",tmp,
strlen(tmp), tmp[0], tmp[1]);
seq == atoi(tmp); //seq
prs_log(LOG_NOTICE,"DEBUG: parsed seq:%d",seq);
the prs_log function writes the message to syslog-ng.
Okay, now the output i'm getting looks like this:
DEBUG: tmp:51 strlen:2 tmp[0]:5 tmp[1]:1
DEBUG: parsed seq:0
What's going on here? I don't understand...
in the first string to see if there's any unprintable characters or
similar in my string...
I'm stuck, any help or tip is appreciated!
Thank you!
Ron