Remove repeated condition from if in X509_NAME_oneline
authorMatt Caswell <matt@openssl.org>
Tue, 17 May 2016 10:07:27 +0000 (11:07 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 17 May 2016 13:27:19 +0000 (14:27 +0100)
An if checks the value of |type| to see if it is V_ASN1_VISIBLESTRING
twice. We only need to do it once.

GitHub Issue #656

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/x509/x509_obj.c

index eaa03f2b883612f689ea0adca91fb5660cb3a2de..1297307462331dfa2eba32a2e3fab53e00bb45b2 100644 (file)
@@ -129,7 +129,7 @@ char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
             type == V_ASN1_VISIBLESTRING ||
             type == V_ASN1_PRINTABLESTRING ||
             type == V_ASN1_TELETEXSTRING ||
-            type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) {
+            type == V_ASN1_IA5STRING) {
             if (num > (int)sizeof(ebcdic_buf))
                 num = sizeof(ebcdic_buf);
             ascii2ebcdic(ebcdic_buf, q, num);