printf: use sprintf() to work around glibc complaining about %n in a writable format...
authorTim-Philipp Müller <tim@centricular.net>
Sun, 14 Apr 2013 10:23:10 +0000 (11:23 +0100)
committerTim-Philipp Müller <tim@centricular.net>
Sun, 14 Apr 2013 10:23:10 +0000 (11:23 +0100)
commit91c42b938001bfd68acb6af951603cebc1bea75b
tree9e0bc3e9f1b9ecb96906eaf766de4bb732fcb9eb
parent637e8b5e1c3e3933008d0049c52f8841c43ac996
printf: use sprintf() to work around glibc complaining about %n in a writable format string

Don't use snprintf(), but use sprintf instead and do our own
length calculations, because glibc may complain about us passing
%n in a format string if the string is in writable memory, and
here the format string is always in writable memory since we
construct it on the fly. This happens if glibc has been compiled
with _FORTIFY_SOURCE=2, which seems to be the case on some
distros/systems). On the upside, we now use the sprintf code path
on all systems which should be better from a maintenance point
of view.

https://bugzilla.gnome.org/show_bug.cgi?id=697970
gst/printf/gst-printf.h