don't use strcpy to copy between overlapping strings, it's undefined operation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-04-11 21:36:06 +00:00
parent 08bc54902d
commit 37c2a8dab0

View 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);
}
/*