Open maska989 opened 1 year ago
Well... :) I have just found that we have a buffer of length 32 that is insufficient to hold the FLT_MIN (given it is 4 byte long) in decimal representation. This final buffer length should assessed as if we approach long double this buffer will bloat very much.
Thanks @niewim19 for the tip. Of course, the buffer needs to be enlarged, but not at the expense of the stack (which is precious on small targets). Perhaps one solution might be to increase the CCL
buffer which is already malloc'ated
and share/use half of the space available for buffering purposes, another way might be to grow with realloc
when it becomes necessary during format parsing. I'll try to figure it out and provide a fix.
Problem occurs when floating-point numbers are used with high precision after coma
Testesd between ia32-generic and host-generic
But after further investigation, @niewim19 found a solution. In scanf.c we need to change line 110
From this:
To this (mine value to test):
And outcome of what we got matched host-generic