diff --git a/src/common/strvararg.cpp b/src/common/strvararg.cpp index 0e1b1592af..f70593c0c5 100644 --- a/src/common/strvararg.cpp +++ b/src/common/strvararg.cpp @@ -642,6 +642,9 @@ wxFormatString::ArgumentType DoGetArgumentType(const CharType *format, wxPrintfConvSpecParser parser(format); + wxCHECK_MSG( n <= parser.nargs, wxFormatString::Arg_Unknown, + "more arguments than format string specifiers?" ); + wxCHECK_MSG( parser.pspec[n-1] != NULL, wxFormatString::Arg_Unknown, "requested argument not found - invalid format string?" );