diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2006-05-09 16:13:32 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2006-05-09 16:13:32 +0000 |
commit | 3987dcfe61f3c9b7311df69ea0b1d73613e94b9b (patch) | |
tree | ee895b623f70cde8a6445bdcc5116de6112492b6 | |
parent | 1e5979dccd1389730d0e6525f9a3d33cbdad5bed (diff) | |
download | libtasn1-3987dcfe61f3c9b7311df69ea0b1d73613e94b9b.tar.gz libtasn1-3987dcfe61f3c9b7311df69ea0b1d73613e94b9b.tar.bz2 libtasn1-3987dcfe61f3c9b7311df69ea0b1d73613e94b9b.zip |
some fixes. node_asn now has value_len set to zero on initialization.
-rw-r--r-- | lib/errors.c | 2 | ||||
-rw-r--r-- | lib/parser_aux.c | 7 | ||||
-rw-r--r-- | lib/structure.c | 7 |
3 files changed, 3 insertions, 13 deletions
diff --git a/lib/errors.c b/lib/errors.c index f1e0d5f..0d3e4a2 100644 --- a/lib/errors.c +++ b/lib/errors.c @@ -83,7 +83,7 @@ libtasn1_perror (asn1_retCode error) /* avoid prefix */ LIBTASN1_ERROR_ALG_LOOP (ret = p->name + sizeof ("ASN1_") - 1); - _libtasn1_log ("LIBTASN1 ERROR: %s\n", ret); + fprintf (stderr, "LIBTASN1 ERROR: %s\n", ret); } diff --git a/lib/parser_aux.c b/lib/parser_aux.c index 16c28ec..fbb6a80 100644 --- a/lib/parser_aux.c +++ b/lib/parser_aux.c @@ -59,7 +59,7 @@ _asn1_add_node (unsigned int type) list_type *listElement; node_asn *punt; - punt = (node_asn *) _asn1_malloc (sizeof (node_asn)); + punt = (node_asn *) _asn1_calloc (1, sizeof (node_asn)); if (punt == NULL) return NULL; @@ -74,12 +74,7 @@ _asn1_add_node (unsigned int type) listElement->next = firstElement; firstElement = listElement; - punt->left = NULL; - punt->name = NULL; punt->type = type; - punt->value = NULL; - punt->down = NULL; - punt->right = NULL; return punt; } diff --git a/lib/structure.c b/lib/structure.c index 70bc172..4b2ee50 100644 --- a/lib/structure.c +++ b/lib/structure.c @@ -51,16 +51,11 @@ _asn1_add_node_only (unsigned int type) { node_asn *punt; - punt = (node_asn *) _asn1_malloc (sizeof (node_asn)); + punt = (node_asn *) _asn1_calloc (1, sizeof (node_asn)); if (punt == NULL) return NULL; - punt->left = NULL; - punt->name = NULL; punt->type = type; - punt->value = NULL; - punt->down = NULL; - punt->right = NULL; return punt; } |