X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c193821a999730fbf6a9bea83763f37daae68f1..8bebc229c7aa9a57fdb4b4955bbe23cd1a44f54a:/src/common/xpmdecod.cpp diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index f3cd26aa0b..c6e10441c9 100644 --- a/src/common/xpmdecod.cpp +++ b/src/common/xpmdecod.cpp @@ -90,7 +90,7 @@ license is as follows: * in this Software without prior written authorization from GROUPE BULL. */ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "xpmdecod.h" #endif @@ -551,7 +551,7 @@ static bool GetRGBFromName(const char *inname, bool *isNone, return TRUE; } - name = wxStrdup(inname); + name = strdup(inname); // theRGBRecords[] has no names with spaces, and no grey, but a // lot of gray... @@ -638,7 +638,7 @@ static const char *ParseColor(const char *data) { if ( *r != *q ) continue; - if ( !wxIsspace((int) (*(r - 1))) ) + if ( !isspace((int) (*(r - 1))) ) continue; p = r; for (;;) @@ -758,6 +758,12 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data) if ( entry == end ) { wxLogError(_("XPM: Malformed pixel data!")); + + // better return right now as otherwise we risk to flood the + // user with error messages as something seems to be seriously + // wrong with the file and so we could give this message for + // each remaining pixel if we don't bail out + return wxNullImage; } else {