fix #2620 and preventing names with dots from breaking.

This commit is contained in:
Hielke Morsink 2016-01-02 14:59:16 +01:00
parent 7914ebd0e2
commit eadb03426e
2 changed files with 1 additions and 2 deletions

View File

@ -109,7 +109,7 @@ void path_remove_extension(utf8 *path)
{
// Find last dot in filename, and replace it with a null-terminator
char *lastDot = strrchr(path, '.');
if (*lastDot) *lastDot = '\0';
if (lastDot != NULL) *lastDot = '\0';
}
bool readentirefile(const utf8 *path, void **outBuffer, int *outLength)

View File

@ -160,7 +160,6 @@ rct_window *window_loadsave_open(int type, char *defaultName)
if (!str_is_null_or_empty(defaultName)) {
safe_strncpy(_defaultName, defaultName, sizeof(_defaultName));
path_remove_extension(_defaultName);
}
w = window_bring_to_front_by_class(WC_LOADSAVE);