Source readability fix, which incidentally works around XLC compiler bug
authorAndy Polyakov <appro@openssl.org>
Mon, 11 Feb 2008 13:20:11 +0000 (13:20 +0000)
committerAndy Polyakov <appro@openssl.org>
Mon, 11 Feb 2008 13:20:11 +0000 (13:20 +0000)
[from HEAD].
PR: 1272

crypto/asn1/t_x509.c

index fe2ea4046d2bd297611fcc983ba60f06f3e41121..eb776b7b3b1f222f7419a4c012da01ccc117b8f3 100644 (file)
@@ -449,13 +449,13 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
 
        l=80-2-obase;
 
-       b=s=X509_NAME_oneline(name,NULL,0);
-       if (!*s)
+       b=X509_NAME_oneline(name,NULL,0);
+       if (!*b)
                {
                OPENSSL_free(b);
                return 1;
                }
-       s++; /* skip the first slash */
+       s=b+1; /* skip the first slash */
 
        c=s;
        for (;;)
@@ -480,8 +480,7 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
                        {
                        i=s-c;
                        if (BIO_write(bp,c,i) != i) goto err;
-                       c+=i;
-                       c++;
+                       c=s+1;  /* skip following slash */
                        if (*s != '\0')
                                {
                                if (BIO_write(bp,", ",2) != 2) goto err;