Demo program for a bug that appears under Termux on Android.
The %n format for printf does not work.
Files:
percent-n-test.cis the test program.correct-output.txtis the correct outputincorrect-output.txtis 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.)