diff options
author | Tom Cosgrove <tom@cvs.openbsd.org> | 2006-10-29 22:51:10 +0000 |
---|---|---|
committer | Tom Cosgrove <tom@cvs.openbsd.org> | 2006-10-29 22:51:10 +0000 |
commit | 5e529ac31922bb759b341e97ed9595ae9d9e1971 (patch) | |
tree | e6431da74f45bfc1ed6316a26c3c232211451e49 /usr.bin | |
parent | 65128e45b90a8fa6bc768318cbaa21be467488bb (diff) |
Optimise a couple of printf()s; originally from Han Boetes.
Reminded by, and ok, otto@.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cal/cal.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c index 151550f948f..8478f185d50 100644 --- a/usr.bin/cal/cal.c +++ b/usr.bin/cal/cal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cal.c,v 1.20 2006/04/25 05:18:26 tedu Exp $ */ +/* $OpenBSD: cal.c,v 1.21 2006/10/29 22:51:09 tom Exp $ */ /* $NetBSD: cal.c,v 1.6 1995/03/26 03:10:24 glass Exp $ */ /* @@ -40,7 +40,7 @@ static const char copyright[] = #if 0 static char sccsid[] = "@(#)cal.c 8.4 (Berkeley) 4/2/94"; #else -static const char rcsid[] = "$OpenBSD: cal.c,v 1.20 2006/04/25 05:18:26 tedu Exp $"; +static const char rcsid[] = "$OpenBSD: cal.c,v 1.21 2006/10/29 22:51:09 tom Exp $"; #endif #endif /* not lint */ @@ -415,9 +415,8 @@ center(const char *str, int len, int separate) { len -= strlen(str); - (void)printf("%*s%s%*s", len / 2, "", str, len / 2 + len % 2, ""); - if (separate) - (void)printf("%*s", separate, ""); + (void)printf("%*s%s%*s", len / 2, "", str, + len / 2 + len % 2 + separate, ""); } void |