diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-06-01 15:39:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-06-01 15:39:53 +0000 |
commit | eb5445b5922e0205b90f3653d1fe0c04b08b8246 (patch) | |
tree | 7ab2f0e1ada75af20c71e4a8ec6d17aa3471c8c4 /lib | |
parent | 39e43ec3020975999c91a2410dab9fbad8a29cff (diff) |
There is no need for is{upper,lower}() tests before to{lower,uppper}(),
since all other characters are mapped through transparently.
ok jsing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/src/crypto/asn1/asn_mime.c | 29 | ||||
-rw-r--r-- | lib/libssl/src/crypto/x509v3/v3_utl.c | 6 |
2 files changed, 8 insertions, 27 deletions
diff --git a/lib/libssl/src/crypto/asn1/asn_mime.c b/lib/libssl/src/crypto/asn1/asn_mime.c index f123a7ddc0a..d3bc90665fa 100644 --- a/lib/libssl/src/crypto/asn1/asn_mime.c +++ b/lib/libssl/src/crypto/asn1/asn_mime.c @@ -826,29 +826,18 @@ mime_hdr_new(char *name, char *value) { MIME_HEADER *mhdr; char *tmpname = NULL, *tmpval = NULL, *p; - int c; if (name) { if (!(tmpname = BUF_strdup(name))) goto err; - for (p = tmpname; *p; p++) { - c = (unsigned char)*p; - if (isupper(c)) { - c = tolower(c); - *p = c; - } - } + for (p = tmpname; *p; p++) + *p = tolower((unsigned char)*p); } if (value) { if (!(tmpval = BUF_strdup(value))) goto err; - for (p = tmpval; *p; p++) { - c = (unsigned char)*p; - if (isupper(c)) { - c = tolower(c); - *p = c; - } - } + for (p = tmpval; *p; p++) + *p = tolower((unsigned char)*p); } mhdr = malloc(sizeof(MIME_HEADER)); if (!mhdr) @@ -870,20 +859,14 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value) { char *tmpname = NULL, *tmpval = NULL, *p; - int c; MIME_PARAM *mparam; if (name) { tmpname = BUF_strdup(name); if (!tmpname) goto err; - for (p = tmpname; *p; p++) { - c = (unsigned char)*p; - if (isupper(c)) { - c = tolower(c); - *p = c; - } - } + for (p = tmpname; *p; p++) + *p = tolower((unsigned char)*p); } if (value) { tmpval = BUF_strdup(value); diff --git a/lib/libssl/src/crypto/x509v3/v3_utl.c b/lib/libssl/src/crypto/x509v3/v3_utl.c index bf6f81a5e9b..4f4dc15221e 100644 --- a/lib/libssl/src/crypto/x509v3/v3_utl.c +++ b/lib/libssl/src/crypto/x509v3/v3_utl.c @@ -468,10 +468,8 @@ string_to_hex(const char *str, long *len) free(hexbuf); return NULL; } - if (isupper(ch)) - ch = tolower(ch); - if (isupper(cl)) - cl = tolower(cl); + ch = tolower(ch); + cl = tolower(cl); if ((ch >= '0') && (ch <= '9')) ch -= '0'; |