Skip leading whitespaces only if neither 0 nor 1 are whitespaces.

This commit is contained in:
zimoch
2012-05-15 09:20:22 +00:00
parent 9585506644
commit 42c305c79b

View File

@ -130,9 +130,10 @@ scanLong(const StreamFormat& format, const char* input, long& value)
int width = format.width;
if (width == 0) width = -1;
int length = 0;
while (isspace(input[length])) length++; // skip whitespaces
char zero = format.info[0];
char one = format.info[1];
if (!isspace(zero) && !isspace(one))
while (isspace(input[length])) length++; // skip whitespaces
if (input[length] != zero && input[length] != one) return -1;
if (format.flags & alt_flag)
{