Mike Bird via tde-devels wrote:
%as is looking for a float so let's ignore that.
I found out %as means do not store (strip) the terminator \0.
If we switch back to %s it's looking for a string
which would be
great except no memory has been allocated for the strings.
The attached works with both gcc and clang but the important thing
to remember is NEVER NEVER NEVER use scanf or any variant thereof.
What do you mean it works with gcc? I have debian with gcc-10 and it does
following:
$ ./test
String: interpreter usb 0x04b8
0x0142 /usr/lib/esci/libesci-interpreter-perfection-v330 /usr/share/esci/esfwad.bin
vendor 4b8
product 142
library (null)
firmware (null)
I am not the owner of this code. It was working for the past 6y and as
reported when compiled last year in Buster it works as well, but now
compiled in Bullseye is not working.
For me it is not the matter of using it or not, but a change somewhere
either in gcc (Buster was using gcc-8) or in the libraries.
Also regarding the memory allocated. You are right. It is working if I
allocate memory and use %s instead of %as.
Why, oh, why?!
Is there some kind of flag or option for the compiler?
--
FCD6 3719 0FFB F1BF 38EA 4727 5348 5F1F DCFE BCB0