ssl/ssl_txt: fix NULL-check
[openssl.git] / ssl / ssl_txt.c
index cb5e86f0251211bd2b9657c02b47e49577795f39..2056de969e73f51cb51360fd217ea6d6217c051d 100644 (file)
@@ -20,12 +20,12 @@ int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *x)
 
     if ((b = BIO_new(BIO_s_file())) == NULL) {
         SSLerr(SSL_F_SSL_SESSION_PRINT_FP, ERR_R_BUF_LIB);
-        return (0);
+        return 0;
     }
     BIO_set_fp(b, fp, BIO_NOCLOSE);
     ret = SSL_SESSION_print(b, x);
     BIO_free(b);
-    return (ret);
+    return ret;
 }
 #endif
 
@@ -44,18 +44,18 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
 
     if (x->cipher == NULL) {
         if (((x->cipher_id) & 0xff000000) == 0x02000000) {
-            if (BIO_printf
-                (bp, "    Cipher    : %06lX\n", x->cipher_id & 0xffffff) <= 0)
+            if (BIO_printf(bp, "    Cipher    : %06lX\n",
+                           x->cipher_id & 0xffffff) <= 0)
                 goto err;
         } else {
-            if (BIO_printf
-                (bp, "    Cipher    : %04lX\n", x->cipher_id & 0xffff) <= 0)
+            if (BIO_printf(bp, "    Cipher    : %04lX\n",
+                           x->cipher_id & 0xffff) <= 0)
                 goto err;
         }
     } else {
-        if (BIO_printf
-            (bp, "    Cipher    : %s\n",
-             ((x->cipher == NULL) ? "unknown" : x->cipher->name)) <= 0)
+        if (BIO_printf(bp, "    Cipher    : %s\n",
+                       ((x->cipher->name == NULL) ? "unknown"
+                                                  : x->cipher->name)) <= 0)
             goto err;
     }
     if (BIO_puts(bp, "    Session-ID: ") <= 0)
@@ -145,9 +145,9 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
                    x->flags & SSL_SESS_FLAG_EXTMS ? "yes" : "no") <= 0)
         goto err;
 
-    return (1);
+    return 1;
  err:
-    return (0);
+    return 0;
 }
 
 /*
@@ -186,7 +186,7 @@ int SSL_SESSION_print_keylog(BIO *bp, const SSL_SESSION *x)
     if (BIO_puts(bp, "\n") <= 0)
         goto err;
 
-    return (1);
+    return 1;
  err:
-    return (0);
+    return 0;
 }