OpenBSD CVS

CVS log for src/usr.bin/printf/printf.c


[BACK] Up to [local] / src / usr.bin / printf

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.27 / (download) - annotate - [select for diffs], Fri May 7 14:31:27 2021 UTC (3 years ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, HEAD
Changes since 1.26: +4 -8 lines
Diff to previous 1.26 (colored)

Fix the \x escape sequence to be limited to max 2 characters, instead of
consuming as long as there are isxdigit(3) characters available.

While here document it and mark it as an extension.

OK millert@

Revision 1.26 / (download) - annotate - [select for diffs], Fri Nov 18 15:53:16 2016 UTC (7 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.25: +9 -13 lines
Diff to previous 1.25 (colored)

Delete useless call to setlocale(3).

While the C library function printf(3) is used here and is
locale-dependent, the printf(1) utility does not use the locale
dependent parts %lc and %ls.  While POSIX requires LC_NUMERIC
support, we intentionally don't implement that in printf(3).
In summary, no functional change.

While here, sort headers and use the usual __dead usage() idiom.
Based on a patch from Jan Stary <hans at stare dot cz>.
OK bentley@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jul 27 01:52:03 2016 UTC (7 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (colored)

fix signed char extension bugs. from fade@cock.li. ok guenther.
As a personal remark, I'll add that it's not necessary to cast a value
to a function's return type. The compiler is happy to do that for you.
But such casts can hide warnings and bugs.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:08 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.23 / (download) - annotate - [select for diffs], Tue Oct 6 23:01:43 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +5 -1 lines
Diff to previous 1.22 (colored)

obvious tame "stdio".  For those not keeping score, this is another
program which has had string mismanagement bugs before, probably
of the exploitable fashion.. if used in the wrong kind of script..

Revision 1.22 / (download) - annotate - [select for diffs], Sun May 25 07:36:36 2014 UTC (9 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

don't use plural "arguments" in SYNOPSIS, since "..." makes it
redundant; tweak the rest of the page to stop using both forms,
and tweak usage(), which was wrong anyway, to match this;

Revision 1.21 / (download) - annotate - [select for diffs], Tue May 20 01:25:23 2014 UTC (10 years ago) by guenther
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Use errc/warnc to simplify code.
Also, in 'ftp', always put the error message last, after the hostname/ipaddr.

ok jsing@ krw@ millert@

Revision 1.20 / (download) - annotate - [select for diffs], Fri Apr 18 11:35:51 2014 UTC (10 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.19: +9 -6 lines
Diff to previous 1.19 (colored)

Handle passing zero to a variable fieldwidth or precision.

ok deraadt@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Nov 20 20:46:47 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

isxdigit() needs unsigned char cast for this specific argument
ok ratchov

Revision 1.18 / (download) - annotate - [select for diffs], Sat Jun 18 02:36:22 2011 UTC (12 years, 11 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.17: +6 -1 lines
Diff to previous 1.17 (colored)

Warn and stop processing if the format string ends with an backslash.
From Andres Perera (andres.p at zoho.com), ok otto@, millert@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:41 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.16: +1 -12 lines
Diff to previous 1.16 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jul 19 15:47:57 2009 UTC (14 years, 10 months ago) by martynas
Branch: MAIN
Changes since 1.15: +2 -30 lines
Diff to previous 1.15 (colored)

remove BUILTIN/SHELL cruft that used to be needed for sh, which is
gone;  and killed in csh w. rev. 1.7.  ok millert@

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jul 17 17:39:30 2009 UTC (14 years, 10 months ago) by martynas
Branch: MAIN
Changes since 1.14: +23 -11 lines
Diff to previous 1.14 (colored)

be more careful with parsing format string.  we can't do multiple
widths or precisions.  fixes crash reported by Maksymilian Arciemowicz,
where printf(3) took more args from stack than printf(1) passed it.
behavior consistent with linucses and ieee 1003.1-2001.
ok millert@, otto@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Sep 8 17:04:20 2008 UTC (15 years, 8 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.13: +5 -2 lines
Diff to previous 1.13 (colored)

enable support for %a, %A, %F.  ok theo

Revision 1.13 / (download) - annotate - [select for diffs], Thu Jun 19 16:24:00 2008 UTC (15 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.12: +8 -2 lines
Diff to previous 1.12 (colored)

printf(1) does not take any options but still needs to ignore the "--"
(end of options) flag.  OK deraadt@ espie@

Revision 1.12 / (download) - annotate - [select for diffs], Mon May 31 15:48:26 2004 UTC (19 years, 11 months ago) by pedro
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.11: +2 -3 lines
Diff to previous 1.11 (colored)

zap unused variables, ok beck@

Revision 1.11 / (download) - annotate - [select for diffs], Mon Jun 23 16:40:44 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.10: +4 -15 lines
Diff to previous 1.10 (colored)

Don't not use getopt() in printf(1) since it causes formats beginning
with a '-' to be interpreted as flags.  Noticed by Alan Barrett.
There is really no reason for this to be a builtin in csh...

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jun 10 22:20:49 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +15 -23 lines
Diff to previous 1.9 (colored)

mostly ansi cleanup; pval ok

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:14 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.8: +3 -7 lines
Diff to previous 1.8 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Mar 30 20:46:29 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

snprintf

Revision 1.7 / (download) - annotate - [select for diffs], Tue Feb 19 19:39:39 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.6: +2 -21 lines
Diff to previous 1.6 (colored)

We live in an ANSI C world.  Remove lots of gratuitous #ifdef __STDC__ cruft.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:51 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.5: +13 -13 lines
Diff to previous 1.5 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Nov 19 19:02:15 2001 UTC (22 years, 6 months ago) by mpech
Branch: MAIN
Changes since 1.4: +6 -6 lines
Diff to previous 1.4 (colored)

kill more registers

millert@ ok

Revision 1.4 / (download) - annotate - [select for diffs], Fri Dec 22 22:53:10 2000 UTC (23 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.3: +29 -5 lines
Diff to previous 1.3 (colored)

repair same static buf oflow in printf(1) and printf(1) internal inside csh(1)

Revision 1.3 / (download) - annotate - [select for diffs], Fri Jan 17 07:13:06 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.2: +6 -6 lines
Diff to previous 1.2 (colored)

r?index -> strr?chr

Revision 1.2 / (download) - annotate - [select for diffs], Wed Jun 26 05:37:59 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +3 -1 lines
Diff to previous 1.1 (colored)

rcsid

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:57 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:57 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.