From: David Griffith Date: Wed, 22 Feb 2017 13:30:01 +0000 (-0800) Subject: Fix for Frotz tries too hard to read game files. #35. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=b6276729d9351186b1c8b217441cdfe9c6a5435b;p=liskon_frotz.git Fix for Frotz tries too hard to read game files. #35. --- diff --git a/src/curses/ux_blorb.c b/src/curses/ux_blorb.c index 5a2daf6..2a2545c 100644 --- a/src/curses/ux_blorb.c +++ b/src/curses/ux_blorb.c @@ -87,9 +87,10 @@ bb_err_t ux_blorb_init(char *filename) len2 = strlen(filename) + strlen(EXT_BLORB3); mystring = malloc(len2 * sizeof(char) + 1); - strncat(mystring, filename, len1 * sizeof(char)); + strncpy(mystring, filename, len1 * sizeof(char)); p = rindex(mystring, '.'); - *p = '\0'; + if (p != NULL) + *p = '\0'; strncat(mystring, EXT_BLORB, len1 * sizeof(char));