From cba11444aba6d3e89c1efd8263d49279dea1f7a5 Mon Sep 17 00:00:00 2001 From: Stuart Henderson Date: Thu, 17 Apr 2014 22:08:46 +0000 Subject: no need for a variable which is hardcoded and only used in an snprintf, ok giovanni@. tidy comments nearby while there. --- lib/libcrypto/x509/by_dir.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'lib/libcrypto/x509') diff --git a/lib/libcrypto/x509/by_dir.c b/lib/libcrypto/x509/by_dir.c index 9795b636204..749323be1e4 100644 --- a/lib/libcrypto/x509/by_dir.c +++ b/lib/libcrypto/x509/by_dir.c @@ -336,11 +336,8 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, hent = NULL; } for (;;) { - char c = '/'; - - (void) snprintf(b->data, b->max, - "%s%c%08lx.%s%d", ent->dir, c, h, - postfix, k); + (void) snprintf(b->data, b->max, "%s/%08lx.%s%d", + ent->dir, h, postfix, k); #ifndef OPENSSL_NO_POSIX_IO { @@ -363,8 +360,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, k++; } - /* we have added it to the cache so now pull - * it out again */ + /* we have added it to the cache so now pull it out again */ CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); j = sk_X509_OBJECT_find(xl->store_ctx->objs, &stmp); if (j != -1) @@ -372,12 +368,11 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, else tmp = NULL; CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE); - /* If a CRL, update the last file suffix added for this */ - if (type == X509_LU_CRL) { CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); - /* Look for entry again in case another thread added + /* + * Look for entry again in case another thread added * an entry first. */ if (!hent) { @@ -408,9 +403,10 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, ok = 1; ret->type = tmp->type; memcpy(&ret->data, &tmp->data, sizeof(ret->data)); - /* If we were going to up the reference count, - * we would need to do it on a perl 'type' - * basis */ + /* + * If we were going to up the reference count, + * we would need to do it on a perl 'type' basis + */ /* CRYPTO_add(&tmp->data.x509->references,1, CRYPTO_LOCK_X509);*/ goto finish; -- cgit v1.2.3