fixed: returned wrong value

This commit is contained in:
ceriel 1988-02-16 17:48:28 +00:00
parent b54a58e93c
commit 7bc8ed1270

View file

@ -65,7 +65,6 @@ union ptr_union *argp; /* our argument list */
goto all_done; goto all_done;
++format; ++format;
ic = getc(iop); ic = getc(iop);
++done;
continue; continue;
} }
++format; ++format;
@ -147,7 +146,7 @@ union ptr_union *argp; /* our argument list */
*(argp++)->uint_p = (unsigned) val; *(argp++)->uint_p = (unsigned) val;
} }
if (done_some) if (done_some)
++done; if (do_assign) ++done;
else else
goto all_done; goto all_done;
break; break;
@ -160,10 +159,11 @@ union ptr_union *argp; /* our argument list */
ic = getc(iop); ic = getc(iop);
done_some = 1; done_some = 1;
} }
if (do_assign) if (do_assign) {
argp++; /* done with this one */ argp++; /* done with this one */
if (done_some) if (done_some)
++done; ++done;
}
break; break;
case 's': case 's':
if (!widflag) if (!widflag)
@ -209,7 +209,7 @@ union ptr_union *argp; /* our argument list */
} }
if (do_assign) /* terminate the string */ if (do_assign) /* terminate the string */
*(argp++)->chr_p = '\0'; *(argp++)->chr_p = '\0';
if (done_some) if (done_some && do_assign)
++done; ++done;
else else
goto all_done; goto all_done;
@ -258,9 +258,9 @@ union ptr_union *argp; /* our argument list */
} }
if (c == buffer) goto all_done; if (c == buffer) goto all_done;
*c = 0; *c = 0;
done++;
if (do_assign) { if (do_assign) {
done++;
if (longflag) if (longflag)
*(argp++)->double_p = atof(buffer); *(argp++)->double_p = atof(buffer);
else else