Reply to Re: Maybe a bug
If you don't have an account, just leave the password field blank.
December 6th 2005, 01:18 AM
toa
Shorts range from 32767 to -32768 so it's not a bug.
However, since the characters returned by 'getc' only range from 0 to 255 (unsigned char casted to int) and the error condition is -1 (EOF), the true condition will never be executed because 'c' will never be greater than 255.
Furthermore, 'strchar' in this context is a painter's error -- better to rewrite it, keeping track of the end of cbuf:
Old: strchar(cbuf,c);
New: cbuf[i++] = c; cbuf[i] = '\0';
However, since the characters returned by 'getc' only range from 0 to 255 (unsigned char casted to int) and the error condition is -1 (EOF), the true condition will never be executed because 'c' will never be greater than 255.
Furthermore, 'strchar' in this context is a painter's error -- better to rewrite it, keeping track of the end of cbuf:
Old: strchar(cbuf,c);
New: cbuf[i++] = c; cbuf[i] = '\0';