summaryrefslogtreecommitdiff
path: root/usr.bin/dc
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-03-15 10:28:39 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-03-15 10:28:39 +0000
commitc5ceb0b1b8a9314ee74fbc771cbc19e54a4ced0a (patch)
treed52d9616ba5842ac2747bac0ecb9115e02dbddfe /usr.bin/dc
parentfbf084345fc1d6199947237fbe7e52d75028bb2a (diff)
snprintf(buf, sizeof(buf), "%s", p) is silly, use strlcpy(). From Bruno Rohee.
Diffstat (limited to 'usr.bin/dc')
-rw-r--r--usr.bin/dc/inout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/dc/inout.c b/usr.bin/dc/inout.c
index 3fcd6d9c8ff..8bfa48b8284 100644
--- a/usr.bin/dc/inout.c
+++ b/usr.bin/dc/inout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inout.c,v 1.8 2003/11/14 20:18:47 otto Exp $ */
+/* $OpenBSD: inout.c,v 1.9 2005/03/15 10:28:38 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: inout.c,v 1.8 2003/11/14 20:18:47 otto Exp $";
+static const char rcsid[] = "$OpenBSD: inout.c,v 1.9 2005/03/15 10:28:38 otto Exp $";
#endif /* not lint */
#include <ssl/ssl.h>
@@ -167,7 +167,7 @@ printwrap(FILE *f, const char *p)
char buf[12];
char *q = buf;
- snprintf(buf, sizeof(buf), "%s", p);
+ strlcpy(buf, p, sizeof(buf));
while (*q)
putcharwrap(f, *q++);
}