From 61630c9631a2bd70570f348c1a65eefb0a864d9d Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Thu, 23 Apr 2015 06:11:19 +0000 Subject: Do not need to buf[0] = 0 before strlcpy(buf, ... --- src/lib/libcrypto/bio/b_dump.c | 3 +-- src/lib/libssl/src/crypto/bio/b_dump.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c index 0943e9006d..0214addc8b 100644 --- a/src/lib/libcrypto/bio/b_dump.c +++ b/src/lib/libcrypto/bio/b_dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b_dump.c,v 1.20 2014/11/11 19:26:12 miod Exp $ */ +/* $OpenBSD: b_dump.c,v 1.21 2015/04/23 06:11:19 deraadt Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -107,7 +107,6 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), if ((rows * dump_width) < len) rows++; for (i = 0; i < rows; i++) { - buf[0] = '\0'; /* start with empty string */ strlcpy(buf, str, sizeof buf); snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width); strlcat(buf, tmp, sizeof buf); diff --git a/src/lib/libssl/src/crypto/bio/b_dump.c b/src/lib/libssl/src/crypto/bio/b_dump.c index 0943e9006d..0214addc8b 100644 --- a/src/lib/libssl/src/crypto/bio/b_dump.c +++ b/src/lib/libssl/src/crypto/bio/b_dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b_dump.c,v 1.20 2014/11/11 19:26:12 miod Exp $ */ +/* $OpenBSD: b_dump.c,v 1.21 2015/04/23 06:11:19 deraadt Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -107,7 +107,6 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), if ((rows * dump_width) < len) rows++; for (i = 0; i < rows; i++) { - buf[0] = '\0'; /* start with empty string */ strlcpy(buf, str, sizeof buf); snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width); strlcat(buf, tmp, sizeof buf); -- cgit v1.2.3-55-g6feb