Head off another potential problem with dotless files when loading a Blorb file.
authorDavid Griffith <dave@661.org>
Wed, 22 Feb 2017 13:31:54 +0000 (05:31 -0800)
committerDavid Griffith <dave@661.org>
Wed, 22 Feb 2017 13:31:54 +0000 (05:31 -0800)
src/curses/ux_blorb.c

index 2a2545c00374aee3a61496192bb766d847b81682..438d5cac2a13237c773c66081ef0f8a74be1c2b1 100644 (file)
@@ -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");
        }