Further OS-X deprecated warnings tweak
[oweals/openssl.git] / crypto / err / err.c
index e1091e3cf73f703d1c195b96021ca026a707d25e..b7ca3ded055dc1f57e076ec204fa1cc5caa778ce 100644 (file)
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
 #include <openssl/lhash.h>
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
@@ -157,6 +157,7 @@ static ERR_STRING_DATA ERR_str_libraries[] = {
     {ERR_PACK(ERR_LIB_FIPS, 0, 0), "FIPS routines"},
     {ERR_PACK(ERR_LIB_CMS, 0, 0), "CMS routines"},
     {ERR_PACK(ERR_LIB_HMAC, 0, 0), "HMAC routines"},
+    {ERR_PACK(ERR_LIB_ASYNC, 0, 0), "ASYNC routines"},
     {0, NULL},
 };
 
@@ -279,7 +280,7 @@ static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit)
         int_error_hash = lh_ERR_STRING_DATA_new();
         CRYPTO_pop_info();
     }
-    if (int_error_hash)
+    if (int_error_hash != NULL)
         ret = int_error_hash;
     if (lockit)
         CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
@@ -326,7 +327,7 @@ static LHASH_OF(ERR_STATE) *int_thread_get(int create, int lockit)
         int_thread_hash = lh_ERR_STATE_new();
         CRYPTO_pop_info();
     }
-    if (int_thread_hash) {
+    if (int_thread_hash != NULL) {
         int_thread_hash_references++;
         ret = int_thread_hash;
     }
@@ -455,8 +456,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;
             }
         }
@@ -882,7 +883,7 @@ ERR_STATE *ERR_get_state(void)
 
     /* ret == the error state, if NULL, make a new one */
     if (ret == NULL) {
-        ret = OPENSSL_malloc(sizeof(ERR_STATE));
+        ret = OPENSSL_malloc(sizeof(*ret));
         if (ret == NULL)
             return (&fallback);
         CRYPTO_THREADID_cpy(&ret->tid, &tid);