mirror of https://github.com/OpenRCT2/OpenRCT2.git
Prevent variable underflow in path_end_with_separator
This commit is contained in:
parent
349ca774ca
commit
2ec1fd0378
|
@ -146,7 +146,7 @@ void path_end_with_separator(utf8 *path, size_t size) {
|
|||
size_t length = strnlen(path, size);
|
||||
if (length >= size - 1) return;
|
||||
|
||||
if (path[length - 1] != *PATH_SEPARATOR)
|
||||
if ((length == 0) || (path[length - 1] != *PATH_SEPARATOR))
|
||||
safe_strcat(path, PATH_SEPARATOR, size);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue