]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/xpmdecod.cpp
fixed typo (no code changes)
[wxWidgets.git] / src / common / xpmdecod.cpp
index cc0e2bad48366147fd31b9f99f46dd9b64e392c3..f8524971a0e7e2f2d8b465c658a6b8537e507b79 100644 (file)
@@ -178,7 +178,10 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream)
             if ( (*q == '*') && (*(q + 1) == '/') )
                 break;
         }
-        strcpy(p, q + 2);
+        
+        // memmove allows overlaps (unlike strcpy):
+        size_t cpylen = strlen(q + 2) + 1;
+        memmove(p, q + 2, cpylen); 
     }
 
     /*
@@ -236,11 +239,7 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream)
      */
     wxImage img = ReadData(xpm_lines);
 
-#ifdef __WIN16__
-    delete[] (char**) xpm_lines;
-#else
     delete[] xpm_lines;
-#endif
 
     return img;
 }