breakp2.c: prevent segfault if missing ')' in 'save' command or line too long

This commit is contained in:
h_vogt 2016-02-27 11:25:42 +01:00 committed by rlar
parent 641c4f474f
commit d99252c915
1 changed files with 6 additions and 0 deletions

View File

@ -161,6 +161,12 @@ copynode(char *s)
return s;
r = strchr(s, ')');
if (!r) {
fprintf(cp_err, "Warning: Missing ')' in %s\n Not saved!\n", s);
*s = '\0';
return s;
}
*r = '\0';
if (*(l - 1) == 'i' || *(l - 1) == 'I')
ret = tprintf("%s#branch", l + 1);