From: David Griffith Date: Wed, 22 Feb 2017 13:31:54 +0000 (-0800) Subject: Head off another potential problem with dotless files when loading a Blorb file. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=a406a7677cde0f5f6d60cbe14ce7b61a7110beaa;p=liskon_frotz.git Head off another potential problem with dotless files when loading a Blorb file. --- diff --git a/src/curses/ux_blorb.c b/src/curses/ux_blorb.c index 2a2545c..438d5ca 100644 --- a/src/curses/ux_blorb.c +++ b/src/curses/ux_blorb.c @@ -101,7 +101,8 @@ bb_err_t ux_blorb_init(char *filename) /* Check if foo.blb is there. */ if ((blorb_fp = fopen(mystring, "rb")) == NULL) { p = rindex(mystring, '.'); - *p = '\0'; + if (p != NULL) + *p = '\0'; strncat(mystring, EXT_BLORB3, len2 * sizeof(char)); blorb_fp = fopen(mystring, "rb"); }