From: bcook Date: Sun, 24 Aug 2014 16:11:39 +0000 (+0000) Subject: constify strerror return value X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ee900073fe038e874d482e8c9ba723dec516354b;p=openbsd constify strerror return value There is no intention to modify the string returned by strerror and doing so is forbidden by the standard. from Jonas 'Sortie' Termansen ok tedu@ deraadt@ --- diff --git a/lib/libcrypto/err/err.c b/lib/libcrypto/err/err.c index 571bfaed167..0802249da45 100644 --- a/lib/libcrypto/err/err.c +++ b/lib/libcrypto/err/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.38 2014/07/11 08:44:48 jsing Exp $ */ +/* $OpenBSD: err.c,v 1.39 2014/08/24 16:11:39 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -596,7 +596,7 @@ build_SYS_str_reasons(void) if (str->string == NULL) { char (*dest)[LEN_SYS_STR_REASON] = &(strerror_tab[i - 1]); - char *src = strerror(i); + const char *src = strerror(i); if (src != NULL) { strlcpy(*dest, src, sizeof *dest); str->string = *dest; diff --git a/lib/libssl/src/crypto/err/err.c b/lib/libssl/src/crypto/err/err.c index 571bfaed167..0802249da45 100644 --- a/lib/libssl/src/crypto/err/err.c +++ b/lib/libssl/src/crypto/err/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.38 2014/07/11 08:44:48 jsing Exp $ */ +/* $OpenBSD: err.c,v 1.39 2014/08/24 16:11:39 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -596,7 +596,7 @@ build_SYS_str_reasons(void) if (str->string == NULL) { char (*dest)[LEN_SYS_STR_REASON] = &(strerror_tab[i - 1]); - char *src = strerror(i); + const char *src = strerror(i); if (src != NULL) { strlcpy(*dest, src, sizeof *dest); str->string = *dest;