don't allow empty format string

This commit is contained in:
ceriel 1990-11-15 17:00:39 +00:00
parent a06482bb41
commit 715dd4ef0f

View file

@ -326,8 +326,7 @@ format_expression(p_tree *p;)
{ p_tree p1; }
:
expression(p, 0)
[ '\\'
[ name(&p1) { register char *c = p1->t_str;
[ '\\' name(&p1) { register char *c = p1->t_str;
while (*c) {
if (! strindex("doshcax", *c)) {
error("illegal format: %c", *c);
@ -337,8 +336,6 @@ format_expression(p_tree *p;)
}
*p = mknode(OP_FORMAT, *p, p1);
}
|
]
|
]
;