X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4676948b6814c97b93c431a8cbcd8c0352c87ba9..5955710c8bd346e8be675bd1dbbd427723a57920:/src/common/xpmdecod.cpp diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index b97af0c98b..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,13 +551,7 @@ static bool GetRGBFromName(const char *inname, bool *isNone, return TRUE; } -#ifdef __WXWINCE__ - // TODO: is this right? How come it compiles on other - // platforms? - name = (char*) wxStrdup((wxChar*) inname); -#else - name = wxStrdup(inname); -#endif + name = strdup(inname); // theRGBRecords[] has no names with spaces, and no grey, but a // lot of gray... @@ -644,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 (;;) @@ -764,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 {