LibC: Fix scanf %n modifier
Old code was always returning off by one
This commit is contained in:
parent
96740d6be4
commit
8834241417
|
@ -596,7 +596,7 @@ int scanf_impl(const char* format, va_list arguments, int (*__getc_fun)(bool adv
|
||||||
}
|
}
|
||||||
case 'n':
|
case 'n':
|
||||||
if (!conversion.suppress)
|
if (!conversion.suppress)
|
||||||
*va_arg(arguments, int*) = nread - (in != NONE);
|
*va_arg(arguments, int*) = nread;
|
||||||
conversion.suppress = true; // Dont count this as conversion
|
conversion.suppress = true; // Dont count this as conversion
|
||||||
result = ConversionResult::SUCCESS;
|
result = ConversionResult::SUCCESS;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue