From 4540716cf7e70b4639a939e6bd1d4861b6c00ebd Mon Sep 17 00:00:00 2001 From: Lars Kanis <kanis@comcard.de> Date: Thu, 13 Mar 2014 17:40:46 +0100 Subject: [PATCH] Avoid security warning about missused format strings. --- swig-interfaces/FXMessageBox.i | 21 +++++++++++++-------- swig-interfaces/ruby-typemaps.i | 1 - 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/swig-interfaces/FXMessageBox.i b/swig-interfaces/FXMessageBox.i index 7bdf5aa..89aa8ab 100644 --- a/swig-interfaces/FXMessageBox.i +++ b/swig-interfaces/FXMessageBox.i @@ -90,29 +90,34 @@ public: } } + %typemap(in) (const char* message_format, const char* message_string) { + $1 = (char*)"%s"; + $2 = RSTRING_PTR($input); + } + /// Show a modal error message - static FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message); + static FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message_format, const char* message_string); // Show modal error message, in free floating window. - static FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message); + static FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message_format, const char* message_string); /// Show a modal warning message - static FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message); + static FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message_format, const char* message_string); /// Show a modal warning message, in a free-floating window - static FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message); + static FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message_format, const char* message_string); /// Show a modal question dialog - static FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message); + static FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message_format, const char* message_string); /// Show a modal question dialog, in a free-floating window - static FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message); + static FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message_format, const char* message_string); /// Show a modal information dialog - static FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message); + static FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message_format, const char* message_string); /// Show a modal information dialog, in a free-floating window - static FXuint information(FXApp* app,FXuint opts,const char* caption,const char* message); + static FXuint information(FXApp* app,FXuint opts,const char* caption,const char* message_format, const char* message_string); // Destructor virtual ~FXMessageBox(); diff --git a/swig-interfaces/ruby-typemaps.i b/swig-interfaces/ruby-typemaps.i index 368bef2..0046dca 100644 --- a/swig-interfaces/ruby-typemaps.i +++ b/swig-interfaces/ruby-typemaps.i @@ -778,4 +778,3 @@ inline void* to_FXEvent(VALUE obj){ // FXulong values %typemap(in) FXulong "$1 = static_cast<FXulong>(NUM2ULONG($input));"; %typemap(out) FXulong "$result = ULONG2NUM($1);"; - -- GitLab