]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/access.c
ncurses 6.4 - patch 20230624
[ncurses.git] / ncurses / tinfo / access.c
index 6c415acaa5cf86ec468aed4ac75ece5c34b844f4..50a5769c3d6358fef4af8f67e9ee7cc8aeddc2b0 100644 (file)
@@ -52,7 +52,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: access.c,v 1.36 2023/04/22 21:19:56 tom Exp $")
+MODULE_ID("$Id: access.c,v 1.37 2023/06/24 21:55:09 tom Exp $")
 
 #define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c))
 
@@ -70,8 +70,8 @@ _nc_rootname(char *path)
     static char *temp;
     char *s;
 
-    temp = strdup(result);
-    result = temp;
+    if ((temp = strdup(result)) != 0)
+       result = temp;
 #if !MIXEDCASE_FILENAMES
     for (s = result; *s != '\0'; ++s) {
        *s = (char) LOWERCASE(*s);