summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1998-06-09 14:51:05 +0000
committerimp <imp@FreeBSD.org>1998-06-09 14:51:05 +0000
commit04f329cb39ba6013086d99c054e70bdcba3f3ae9 (patch)
treecf9ee3c11ad990143cf9252c8e09d46459e6ef38 /usr.bin
parent9d3db765ca348dc273a136848d1d42795119d828 (diff)
downloadFreeBSD-src-04f329cb39ba6013086d99c054e70bdcba3f3ae9.zip
FreeBSD-src-04f329cb39ba6013086d99c054e70bdcba3f3ae9.tar.gz
sizeof(foo - 1) isn't the same as sizeof(foo) - 1.
Pointed out by: Theo De Raadt.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tip/tip/tip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tip/tip/tip.c b/usr.bin/tip/tip/tip.c
index b4298a9..737a97e 100644
--- a/usr.bin/tip/tip/tip.c
+++ b/usr.bin/tip/tip/tip.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: tip.c,v 1.7 1997/09/18 14:07:17 phk Exp $";
+ "$Id: tip.c,v 1.8 1998/06/09 04:28:05 imp Exp $";
#endif /* not lint */
/*
@@ -153,9 +153,9 @@ main(argc, argv)
* Copy the number then stomp on the original (in case the number
* is private, we don't want 'ps' or 'w' to find it).
*/
- if (strlen(system) > sizeof(PNbuf - 1))
+ if (strlen(system) > sizeof(PNbuf) - 1)
errx(1, "phone number too long (max = %d bytes)", sizeof PNbuf - 1);
- strncpy(PNbuf, system, sizeof(PNbuf - 1));
+ strncpy(PNbuf, system, sizeof(PNbuf) - 1);
for (p = system; *p; p++)
*p = '\0';
PN = PNbuf;
OpenPOWER on IntegriCloud