]> granicus.if.org Git - graphviz/commitdiff
Fix bug in sscanf - sometimes failed when couldn't scan complete format
authorerg <devnull@localhost>
Thu, 21 Apr 2005 01:39:14 +0000 (01:39 +0000)
committererg <devnull@localhost>
Thu, 21 Apr 2005 01:39:14 +0000 (01:39 +0000)
spec.

lib/expr/exeval.c

index 7afc360c988349f962c490772c3e1d132252872f..0b09ea02de1e7e5b37d970ba2973d1f356678970 100644 (file)
@@ -472,7 +472,7 @@ static int scan(Expr_t * ex, Exnode_t * expr, void *env, Sfio_t * sp)
     n = sp ? sfscanf(sp, "%!", &fmt) : sfsscanf(v.string, "%!", &fmt);
     if (fmt.tmp)
        sfstrclose(fmt.tmp);
-    if (fmt.actuals)
+    if (fmt.actuals && !*fmt.fmt.form)
        exerror("scanf: %s: too many arguments",
                fmt.actuals->data.operand.left->data.variable.symbol->
                name);