SCCS-vsn: usr.bin/printf/printf.c 5.5
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)printf.c 5.5 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
/* skip to field width */
for (; index(skip1, *fmt); ++fmt);
/* skip to field width */
for (; index(skip1, *fmt); ++fmt);
- if (*fmt == '*')
- fieldwidth = getint();
- /* skip to possible '.' */
+ fieldwidth = *fmt == '*' ? getint() : 0;
+
+ /* skip to possible '.', get following precision */
for (; index(skip2, *fmt); ++fmt);
if (*fmt == '.')
++fmt;
for (; index(skip2, *fmt); ++fmt);
if (*fmt == '.')
++fmt;
- if (*fmt == '*')
- precision = getint();
+ precision = *fmt == '*' ? getint() : 0;
+
/* skip to conversion char */
for (; index(skip2, *fmt); ++fmt);
if (!*fmt) {
/* skip to conversion char */
for (; index(skip2, *fmt); ++fmt);
if (!*fmt) {