From: erg Date: Thu, 21 Apr 2005 01:39:14 +0000 (+0000) Subject: Fix bug in sscanf - sometimes failed when couldn't scan complete format X-Git-Tag: LAST_LIBGRAPH~32^2~7642 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4c5d255c032478f19069adc8db5186b64aba888;p=graphviz Fix bug in sscanf - sometimes failed when couldn't scan complete format spec. --- diff --git a/lib/expr/exeval.c b/lib/expr/exeval.c index 7afc360c9..0b09ea02d 100644 --- a/lib/expr/exeval.c +++ b/lib/expr/exeval.c @@ -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);