Actually, this should be a memcpy().

We already know the exact length we just allocated, and we plan to append
 our own null terminator to the end of the copy, so this makes more sense.
This commit is contained in:
Ryan C. Gordon 2013-08-20 23:20:32 -04:00
parent a03a7f7745
commit 0f758bdbfd

View file

@ -63,7 +63,7 @@ SDL_GetBasePath(void)
return NULL; return NULL;
} }
strcpy(retval, str); SDL_memcpy(retval, str, len);
retval[len] = '/'; retval[len] = '/';
retval[len+1] = '\0'; retval[len+1] = '\0';
return retval; return retval;