Closed BSzili closed 1 year ago
The %n conversion specifier mistakenly increases the return count for sscanf. I made a small test program that can be built with m68k-amigaos-gcc -noixemul -Wall -o sscanftest sscanftest.c
m68k-amigaos-gcc -noixemul -Wall -o sscanftest sscanftest.c
#include <stdio.h> int main(void) { char buff[] = {"1234"}; int intVal, numRead; int params = sscanf(buff, "%u%n", &intVal, &numRead); printf("intVal %d numRead %d params %d\n", intVal, numRead, params); return 0; }
It should produce the output intVal 1234 numRead 4 params 1, but instead params becomes 2 with libnix.
intVal 1234 numRead 4 params 1
ae98273f87d3f2ce750ff397e6518a6847d4c642 fixed it, thanks!
The %n conversion specifier mistakenly increases the return count for sscanf. I made a small test program that can be built with
m68k-amigaos-gcc -noixemul -Wall -o sscanftest sscanftest.c
It should produce the output
intVal 1234 numRead 4 params 1
, but instead params becomes 2 with libnix.