From: ceriel Date: Tue, 16 Feb 1988 17:48:28 +0000 (+0000) Subject: fixed: returned wrong value X-Git-Tag: release-5-5~3613 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=7bc8ed12709f870adefa4f62dd2914a852fb2b8c;p=ack.git fixed: returned wrong value --- diff --git a/lang/cem/libcc/stdio/doscan.c b/lang/cem/libcc/stdio/doscan.c index 48c8883ab..141bfc9b0 100644 --- a/lang/cem/libcc/stdio/doscan.c +++ b/lang/cem/libcc/stdio/doscan.c @@ -65,7 +65,6 @@ union ptr_union *argp; /* our argument list */ goto all_done; ++format; ic = getc(iop); - ++done; continue; } ++format; @@ -147,7 +146,7 @@ union ptr_union *argp; /* our argument list */ *(argp++)->uint_p = (unsigned) val; } if (done_some) - ++done; + if (do_assign) ++done; else goto all_done; break; @@ -160,10 +159,11 @@ union ptr_union *argp; /* our argument list */ ic = getc(iop); done_some = 1; } - if (do_assign) + if (do_assign) { argp++; /* done with this one */ - if (done_some) - ++done; + if (done_some) + ++done; + } break; case 's': if (!widflag) @@ -209,7 +209,7 @@ union ptr_union *argp; /* our argument list */ } if (do_assign) /* terminate the string */ *(argp++)->chr_p = '\0'; - if (done_some) + if (done_some && do_assign) ++done; else goto all_done; @@ -258,9 +258,9 @@ union ptr_union *argp; /* our argument list */ } if (c == buffer) goto all_done; *c = 0; - done++; if (do_assign) { + done++; if (longflag) *(argp++)->double_p = atof(buffer); else