Fix fakename streamfile for extensionless names

This commit is contained in:
bnnm 2020-05-24 12:45:14 +02:00
parent 66d3e14fe5
commit 1a4de84b1f

View File

@ -680,9 +680,12 @@ STREAMFILE* open_fakename_streamfile(STREAMFILE *streamfile, const char *fakenam
} }
if (fakeext) { if (fakeext) {
char * ext = strrchr(this_sf->fakename,'.'); char* ext = strrchr(this_sf->fakename,'.');
if (ext != NULL) if (ext != NULL) {
ext[1] = '\0'; /* truncate past dot */ ext[1] = '\0'; /* truncate past dot */
} else {
strcat(this_sf->fakename, "."); /* no extension = add dot */
}
strcat(this_sf->fakename, fakeext); strcat(this_sf->fakename, fakeext);
} }