diff options
author | Rich Salz <rsalz@openssl.org> | 2017-12-08 15:08:43 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-12-08 15:08:43 -0500 |
commit | c6738fd208c143939b6bb7f7ac2061c0f5ff3272 (patch) | |
tree | a270d65f499b082d936057e1201acf76c98f570a /crypto/err | |
parent | a1daedd88445397a4aebf22ba63e92c3f1977870 (diff) |
Standardize syntax around sizeof(foo)
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4875)
Diffstat (limited to 'crypto/err')
-rw-r--r-- | crypto/err/err.c | 4 | ||||
-rw-r--r-- | crypto/err/err_prn.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c index cfe0e8083f..e9ef2156e1 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -602,8 +602,8 @@ static void build_SYS_str_reasons(void) char (*dest)[LEN_SYS_STR_REASON] = &(strerror_tab[i - 1]); char *src = strerror(i); if (src != NULL) { - strncpy(*dest, src, sizeof *dest); - (*dest)[sizeof *dest - 1] = '\0'; + strncpy(*dest, src, sizeof(*dest)); + (*dest)[sizeof(*dest) - 1] = '\0'; str->string = *dest; } } diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index 6e352effe3..25c808eab7 100644 --- a/crypto/err/err_prn.c +++ b/crypto/err/err_prn.c @@ -77,7 +77,7 @@ void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u), CRYPTO_THREADID_current(&cur); es = CRYPTO_THREADID_hash(&cur); while ((l = ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) { - ERR_error_string_n(l, buf, sizeof buf); + ERR_error_string_n(l, buf, sizeof(buf)); BIO_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) |