SCCS-vsn: usr.bin/printf/printf.c 5.8
SCCS-vsn: usr.bin/printf/printf.1 5.6
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.\" @(#)printf.1 5.5 (Berkeley) %G%
+.\" @(#)printf.1 5.6 (Berkeley) %G%
or
.IR s ;
otherwise it is evaluated as a C constant, with the following extensions:
or
.IR s ;
otherwise it is evaluated as a C constant, with the following extensions:
A leading plus or minus sign is allowed.
A leading plus or minus sign is allowed.
If the leading character is a single or double quote, or not a digit,
plus, or minus sign, the value is the ASCII code of the next character.
If the leading character is a single or double quote, or not a digit,
plus, or minus sign, the value is the ASCII code of the next character.
.PP
The format string is reused as often as necessary to satisfy the
.IR arguments .
.PP
The format string is reused as often as necessary to satisfy the
.IR arguments .
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)printf.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)printf.c 5.8 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
if (!*gargv)
return((long)0);
if (index(number, **gargv))
if (!*gargv)
return((long)0);
if (index(number, **gargv))
- return(atol(*gargv++));
+ return(strtol(*gargv++, (char **)NULL, 0));
return((long)asciicode());
}
return((long)asciicode());
}