Add a warning
authorThomas White <taw@physics.org>
Sun, 4 Mar 2018 21:06:53 +0000 (22:06 +0100)
committerThomas White <taw@physics.org>
Sun, 4 Mar 2018 21:06:53 +0000 (22:06 +0100)
src/sc_parse.c

index 26f9303..b39d183 100644 (file)
@@ -666,6 +666,10 @@ SCBlock *sc_parse(const char *sc)
 
 void sc_block_set_name(SCBlock *bl, char *nam)
 {
+       if ( bl == NULL ) {
+               fprintf(stderr, "sc_block_set_name: NULL block\n");
+               return;
+       }
        free(bl->name);
        bl->name = nam;
 }