summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/f_string.c
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>1999-06-04 21:35:58 +0000
committerUlf Möller <ulf@openssl.org>1999-06-04 21:35:58 +0000
commita53955d8abd68c604de02cc1e101c66169207fb7 (patch)
treee51051484f2b073f7b58a1549442bf0657ca2978 /crypto/asn1/f_string.c
parent9231f4779677a3cb95a4f8ccebd56432cb914498 (diff)
Support the EBCDIC character set and BS2000/OSD-POSIX (work in progress).
Submitted by: Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>
Diffstat (limited to 'crypto/asn1/f_string.c')
-rw-r--r--crypto/asn1/f_string.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c
index 9bcc5a93c9..e6e9b9d5e2 100644
--- a/crypto/asn1/f_string.c
+++ b/crypto/asn1/f_string.c
@@ -123,9 +123,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')) ||
((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]))
+#endif
{
i=j;
break;