dtstyle: Coverity 87763
authorPeter Howkins <flibble@users.sf.net>
Tue, 3 Jul 2018 17:39:32 +0000 (18:39 +0100)
committerPeter Howkins <flibble@users.sf.net>
Tue, 3 Jul 2018 17:39:32 +0000 (18:39 +0100)
cde/programs/dtstyle/ColorFile.c

index fe44ca5bca0fe3bfee8cadf3e47610637655c31a..5c87e8cff42c929bedee791c1291d466f5a99a77 100644 (file)
@@ -248,7 +248,9 @@ ReadPalette(
 
     /* load the filename into the name element */
       p = strstr (in_filename, PALETTE_SUFFIX);
-      *p = '\0';
+      if(p) {
+          *p = '\0';
+      }
       strcpy(new_palette->name, in_filename);
 
 /*