From b99ddb4df8b0e933b6392cad7b5acc1dddc794d2 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Sat, 19 Apr 2014 00:41:39 +0000 Subject: use intrinsic strlcpy and strlcat everywhere so we only have one set of funcitons to check for incorrect use. keep BUF_strlcpy and BUF_strlcat for API comptibility only. ok tedu@ --- lib/libcrypto/bio/b_dump.c | 14 +++++++------- lib/libcrypto/bio/bss_file.c | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/libcrypto/bio') diff --git a/lib/libcrypto/bio/b_dump.c b/lib/libcrypto/bio/b_dump.c index ff75069df86..61c9fe20a3a 100644 --- a/lib/libcrypto/bio/b_dump.c +++ b/lib/libcrypto/bio/b_dump.c @@ -107,29 +107,29 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), rows++; for (i = 0; i < rows; i++) { buf[0] = '\0'; /* start with empty string */ - BUF_strlcpy(buf, str, sizeof buf); + strlcpy(buf, str, sizeof buf); (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width); - BUF_strlcat(buf, tmp, sizeof buf); + strlcat(buf, tmp, sizeof buf); for (j = 0; j < dump_width; j++) { if (((i*dump_width) + j) >= len) { - BUF_strlcat(buf, " ", sizeof buf); + strlcat(buf, " ", sizeof buf); } else { ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff; (void) snprintf(tmp, sizeof tmp, "%02x%c", ch, j == 7 ? '-' : ' '); - BUF_strlcat(buf, tmp, sizeof buf); + strlcat(buf, tmp, sizeof buf); } } - BUF_strlcat(buf, " ", sizeof buf); + strlcat(buf, " ", sizeof buf); for (j = 0; j < dump_width; j++) { if (((i*dump_width) + j) >= len) break; ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff; (void) snprintf(tmp, sizeof tmp, "%c", ((ch >= ' ') && (ch <= '~')) ? ch : '.'); - BUF_strlcat(buf, tmp, sizeof buf); + strlcat(buf, tmp, sizeof buf); } - BUF_strlcat(buf, "\n", sizeof buf); + strlcat(buf, "\n", sizeof buf); /* if this is the last call then update the ddt_dump thing so * that we will move the selection point in the debug window */ diff --git a/lib/libcrypto/bio/bss_file.c b/lib/libcrypto/bio/bss_file.c index 995c6233411..acc746260ed 100644 --- a/lib/libcrypto/bio/bss_file.c +++ b/lib/libcrypto/bio/bss_file.c @@ -246,14 +246,14 @@ file_ctrl(BIO *b, int cmd, long num, void *ptr) b->shutdown = (int)num&BIO_CLOSE; if (num & BIO_FP_APPEND) { if (num & BIO_FP_READ) - BUF_strlcpy(p, "a+", sizeof p); - else BUF_strlcpy(p, "a", sizeof p); + strlcpy(p, "a+", sizeof p); + else strlcpy(p, "a", sizeof p); } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) - BUF_strlcpy(p, "r+", sizeof p); + strlcpy(p, "r+", sizeof p); else if (num & BIO_FP_WRITE) - BUF_strlcpy(p, "w", sizeof p); + strlcpy(p, "w", sizeof p); else if (num & BIO_FP_READ) - BUF_strlcpy(p, "r", sizeof p); + strlcpy(p, "r", sizeof p); else { BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE); ret = 0; -- cgit v1.2.3