diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 16:45:23 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 16:45:23 +0100 |
commit | 87eaca2a83999caa575df98a7d7e483251c361ee (patch) | |
tree | 772d63ea7ff39acb53baa50e89ac1d0c2fec99f9 /lib/element.c | |
parent | 8cd1f611d962eb62db6b5beb5b395597ce463110 (diff) | |
download | libtasn1-87eaca2a83999caa575df98a7d7e483251c361ee.tar.gz libtasn1-87eaca2a83999caa575df98a7d7e483251c361ee.tar.bz2 libtasn1-87eaca2a83999caa575df98a7d7e483251c361ee.zip |
simplified
Diffstat (limited to 'lib/element.c')
-rw-r--r-- | lib/element.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/element.c b/lib/element.c index 2c761c5..a49758b 100644 --- a/lib/element.c +++ b/lib/element.c @@ -389,7 +389,6 @@ asn1_write_value (asn1_node node_root, const char *name, memcpy (value_temp, value, len); } - if (value_temp[0] & 0x80) negative = 1; else @@ -501,12 +500,12 @@ asn1_write_value (asn1_node node_root, const char *name, break; case ASN1_ETYPE_UTC_TIME: { - if (_asn1_strlen (value) < 11) + if (len < 11) return ASN1_VALUE_NOT_VALID; for (k = 0; k < 10; k++) if (!isdigit (value[k])) return ASN1_VALUE_NOT_VALID; - switch (_asn1_strlen (value)) + switch (len) { case 11: if (value[10] != 'Z') @@ -536,12 +535,12 @@ asn1_write_value (asn1_node node_root, const char *name, default: return ASN1_VALUE_NOT_FOUND; } - _asn1_set_value (node, value, _asn1_strlen (value)); + _asn1_set_value (node, value, len); } break; case ASN1_ETYPE_GENERALIZED_TIME: if (value) - _asn1_set_value (node, value, _asn1_strlen (value)); + _asn1_set_value (node, value, len); break; case ASN1_ETYPE_OCTET_STRING: case ASN1_ETYPE_GENERALSTRING: |