X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fasn1%2Ff_string.c;h=7d9eb1475aca9719ab2d20dfdd8c7cfe2cc9016f;hb=b5292f7b40fd5da1feff4d5394f84c629c97eda4;hp=c82f2a192d49162015304e84839532602c5ea639;hpb=666964780a245c14e8f0eb6e13dd854a37387ea9;p=oweals%2Fopenssl.git diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c index c82f2a192d..7d9eb1475a 100644 --- a/crypto/asn1/f_string.c +++ b/crypto/asn1/f_string.c @@ -1,4 +1,3 @@ -/* crypto/asn1/f_string.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,7 +56,7 @@ */ #include -#include "cryptlib.h" +#include "internal/cryptlib.h" #include #include @@ -95,7 +94,7 @@ int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) { - int i, j, k, m, n, again, bufsize; + int i, j, k, m, n, again, bufsize, spec_char; unsigned char *s = NULL, *sp; unsigned char *bufp; int num = 0, slen = 0, first = 1; @@ -123,18 +122,18 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) for (j = i - 1; j > 0; j--) { #ifndef CHARSET_EBCDIC - if (!(((buf[j] >= '0') && (buf[j] <= '9')) || + spec_char = (!(((buf[j] >= '0') && (buf[j] <= '9')) || ((buf[j] >= 'a') && (buf[j] <= 'f')) || - ((buf[j] >= 'A') && (buf[j] <= 'F')))) + ((buf[j] >= 'A') && (buf[j] <= 'F')))); #else /* * This #ifdef is not strictly necessary, since the characters * A...F a...f 0...9 are contiguous (yes, even in EBCDIC - but * not the whole alphabet). Nevertheless, isxdigit() is faster. */ - if (!isxdigit(buf[j])) + spec_char = (!isxdigit(buf[j])); #endif - { + if (spec_char) { i = j; break; }