OSSL_STORE: spell error reason correctly
[openssl.git] / crypto / err / err.c
index 906e3543e16b878f0638c2b8bfda7d3508689666..8d0ed6faf322ed24651be608a869c2b67967753a 100644 (file)
@@ -162,7 +162,9 @@ static unsigned long err_string_data_hash(const ERR_STRING_DATA *a)
 static int err_string_data_cmp(const ERR_STRING_DATA *a,
                                const ERR_STRING_DATA *b)
 {
-    return (int)(a->error - b->error);
+    if (a->error == b->error)
+        return 0;
+    return a->error > b->error ? 1 : -1;
 }
 
 static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *d)
@@ -757,6 +759,8 @@ void ERR_add_error_vdata(int num, va_list args)
     n = 0;
     for (i = 0; i < num; i++) {
         a = va_arg(args, char *);
+        if (a == NULL)
+            a = "<NULL>";
         n += strlen(a);
         if (n > s) {
             s = n + 20;