Demo program for a bug that appears under Termux on Android.
The %n
format for printf
does not work.
Files:
percent-n-test.c
is the test program.correct-output.txt
is the correct outputincorrect-output.txt
is the output under Termux on my Nexus 9, Android 7.1.1
UPDATE : The problem is that the C runtime library used by Android,
bionic,
deliberately disables the %n
format
specifier for *print()
, as explained
here.
(There are some known security problems with %n
, but this means
the C implementation is non-conforming.)