From a406a7677cde0f5f6d60cbe14ce7b61a7110beaa Mon Sep 17 00:00:00 2001 From: David Griffith Date: Wed, 22 Feb 2017 05:31:54 -0800 Subject: [PATCH] Head off another potential problem with dotless files when loading a Blorb file. --- src/curses/ux_blorb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); } -- 2.34.1