nightingale-media-player / nightingale-deps

Nightingale build deps - Windows, Linux, Mac - all the sources right here (for now)
http://getnightingale.com/forum/
23 stars 14 forks source link

Get rid of [-Wformat-security] warning in nsFilePicker.cpp #26

Open darealshinji opened 9 years ago

darealshinji commented 9 years ago

Any idea how to fix the remaining [-Wformat-security] warning in xulrunner-1.9.2/mozilla/widget/src/gtk2/nsFilePicker.cpp? I don't really know if putting a "%s", in front of NS_ConvertUTF16toUTF8 is the correct way to do this here. https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-Wformat_-Wformat-security

/build/buildd/nightingale-deps-20140722/xulrunner-1.9.2/mozilla/widget/src/gtk2/nsFilePicker.cpp: In function 'PRBool confirm_overwrite_file(GtkWidget*, nsILocalFile*)':
/build/buildd/nightingale-deps-20140722/xulrunner-1.9.2/mozilla/widget/src/gtk2/nsFilePicker.cpp:410:71: warning: format not a string literal and no format arguments [-Wformat-security]
                                   NS_ConvertUTF16toUTF8(message).get());
                                                                       ^
freaktechnik commented 9 years ago

Firt of all, you will surely get a valid UTF8 string from a NS_ConvertUTF16toUTF8 object. Further it doesn't seem as if the gtk_window_set_title method supports three arguments: https://developer.gnome.org/gtk2/stable/GtkWindow.html#gtk-window-set-title P.S.: Direct link to the source where the warning origins from: https://github.com/nightingale-media-player/nightingale-deps/blob/xul-192-new/xulrunner-1.9.2/mozilla/widget/src/gtk2/nsFilePicker.cpp#L411