forked from rosebudai/OpenRCT2-Web
Only copy strings when they're different
When called from window_loadsave_scrollmousedown, window_loadsave_populate_list will try to strncpy a string over itself. This commit prevents that.
This commit is contained in:
1 parent
a24b3e114c
commit
79552feb54
1 file changed
+3
-1
@@ -600,7 +600,9 @@ static void window_loadsave_populate_list(int includeNewItem, bool browsable, co
|
||||
char *dst, filter[MAX_PATH], subDir[MAX_PATH];
|
||||
|
||||
strncpy(_directory, directory, sizeof(_directory));
|
||||
strncpy(_extension, extension, sizeof(_extension));
|
||||
if (_extension != extension) {
|
||||
strncpy(_extension, extension, sizeof(_extension));
|
||||
}
|
||||
_shortenedDirectory[0] = '\0';
|
||||
|
||||
strncpy(filter, directory, sizeof(filter));
|
||||
|
||||
Reference in new issue
Block a user