From 8de0117e810bf2887ba81b54345d86f49dd504a8 Mon Sep 17 00:00:00 2001 From: beck <> Date: Tue, 15 Apr 2014 16:21:04 +0000 Subject: Part 1 of eliminating BIO_snprintf(). This fixes mechanical conversions where the return value is ignored changing to (void) snprintf. ok deraadt@ --- src/lib/libcrypto/err/err.c | 8 ++++---- src/lib/libcrypto/err/err_prn.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib/libcrypto/err') diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index 0251248baf..ae9a209ad7 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c @@ -872,13 +872,13 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len) rs=ERR_reason_error_string(e); if (ls == NULL) - BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l); + (void) snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l); if (fs == NULL) - BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f); + (void) snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f); if (rs == NULL) - BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r); + (void) snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r); - BIO_snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, + (void) snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, fs?fs:fsbuf, rs?rs:rsbuf); if (strlen(buf) == len-1) { diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c index a0168ac8ed..7374c0abe7 100644 --- a/src/lib/libcrypto/err/err_prn.c +++ b/src/lib/libcrypto/err/err_prn.c @@ -79,7 +79,7 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) { ERR_error_string_n(l, buf, sizeof buf); - BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf, + (void) snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf, file, line, (flags & ERR_TXT_STRING) ? data : ""); if (cb(buf2, strlen(buf2), u) <= 0) break; /* abort outputting the error report */ -- cgit v1.2.3-55-g6feb