expandlabel(): if empty node name is given return empty string instead of NULL

This commit is contained in:
stefan schippers 2023-10-06 11:24:00 +02:00
parent 3e4f49dbea
commit 4f0377f1e9
1 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ const char *expandlabel(const char *s, int *m)
if(parselabel_debug >= 3) fprintf(errfp, "expandlabel(): entering\n");
if(!strpbrk(s, "*,.:")) { /* shortcut: nothing to parse / expand */
*m = 1;
my_strdup(_ALLOC_ID_, &dest_string.str, s);
my_strdup2(_ALLOC_ID_, &dest_string.str, s);
return dest_string.str;
}
buf=yy_scan_string(s);
@ -134,7 +134,7 @@ const char *expandlabel(const char *s, int *m)
}
} else {
*m=-1;
my_strdup(_ALLOC_ID_, &dest_string.str, s);
my_strdup2(_ALLOC_ID_, &dest_string.str, s);
}
return dest_string.str;
}