Skip leading whitespaces only if neither 0 nor 1 are whitespaces.
This commit is contained in:
@ -130,9 +130,10 @@ scanLong(const StreamFormat& format, const char* input, long& value)
|
|||||||
int width = format.width;
|
int width = format.width;
|
||||||
if (width == 0) width = -1;
|
if (width == 0) width = -1;
|
||||||
int length = 0;
|
int length = 0;
|
||||||
while (isspace(input[length])) length++; // skip whitespaces
|
|
||||||
char zero = format.info[0];
|
char zero = format.info[0];
|
||||||
char one = format.info[1];
|
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 (input[length] != zero && input[length] != one) return -1;
|
||||||
if (format.flags & alt_flag)
|
if (format.flags & alt_flag)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user