diff options
Diffstat (limited to 'lib/structure.c')
-rw-r--r-- | lib/structure.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/lib/structure.c b/lib/structure.c index ffb6aa5..01715b1 100644 --- a/lib/structure.c +++ b/lib/structure.c @@ -134,7 +134,7 @@ _asn1_create_static_structure (asn1_node pointer, char *output_file_name, { while (1) { - p = _asn1_get_up (p); + p = _asn1_find_up (p); if (p == pointer) { p = NULL; @@ -183,6 +183,8 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, int result; unsigned int type; + if (errorDescription) + errorDescription[0] = 0; if (*definitions != NULL) return ASN1_ELEMENT_NOT_EMPTY; @@ -221,7 +223,7 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, if (p_last == *definitions) break; - p_last = _asn1_get_up (p_last); + p_last = _asn1_find_up (p_last); if (p_last == NULL) break; @@ -321,7 +323,7 @@ asn1_delete_structure2 (asn1_node * structure, unsigned int flags) p2 = p->right; if (p != *structure) { - p3 = _asn1_get_up (p); + p3 = _asn1_find_up (p); _asn1_set_down (p3, p2); _asn1_remove_node (p, flags); p = p3; @@ -331,7 +333,7 @@ asn1_delete_structure2 (asn1_node * structure, unsigned int flags) p3 = _asn1_find_left (p); if (!p3) { - p3 = _asn1_get_up (p); + p3 = _asn1_find_up (p); if (p3) _asn1_set_down (p3, p2); else @@ -379,7 +381,7 @@ asn1_delete_element (asn1_node structure, const char *element_name) p3 = _asn1_find_left (source_node); if (!p3) { - p3 = _asn1_get_up (source_node); + p3 = _asn1_find_up (source_node); if (p3) _asn1_set_down (p3, p2); else if (source_node->right) @@ -441,8 +443,8 @@ _asn1_copy_structure3 (asn1_node source_node) else { move = UP; - p_s = _asn1_get_up (p_s); - p_d = _asn1_get_up (p_d); + p_s = _asn1_find_up (p_s); + p_d = _asn1_find_up (p_d); } } while (p_s != source_node); @@ -542,7 +544,7 @@ _asn1_type_choice_config (asn1_node node) move = UP; } if (move == UP) - p = _asn1_get_up (p); + p = _asn1_find_up (p); } return ASN1_SUCCESS; @@ -593,7 +595,7 @@ _asn1_expand_identifier (asn1_node * node, asn1_node root) _asn1_set_right (p3, p2); else { - p3 = _asn1_get_up (p); + p3 = _asn1_find_up (p); if (p3) _asn1_set_down (p3, p2); else @@ -649,7 +651,7 @@ _asn1_expand_identifier (asn1_node * node, asn1_node root) move = UP; } if (move == UP) - p = _asn1_get_up (p); + p = _asn1_find_up (p); } return ASN1_SUCCESS; @@ -832,7 +834,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name, fprintf (out, " value:0x"); if (len > 0) for (k = 0; k < len; k++) - fprintf (out, "%02x", (p->value)[k + len2]); + fprintf (out, "%02x", (unsigned) (p->value)[k + len2]); } break; case ASN1_ETYPE_ENUMERATED: @@ -843,7 +845,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name, fprintf (out, " value:0x"); if (len > 0) for (k = 0; k < len; k++) - fprintf (out, "%02x", (p->value)[k + len2]); + fprintf (out, "%02x", (unsigned) (p->value)[k + len2]); } break; case ASN1_ETYPE_BOOLEAN: @@ -865,7 +867,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name, fprintf (out, " value(%i):", (len - 1) * 8 - (p->value[len2])); for (k = 1; k < len; k++) - fprintf (out, "%02x", (p->value)[k + len2]); + fprintf (out, "%02x", (unsigned) (p->value)[k + len2]); } } break; @@ -905,7 +907,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name, fprintf (out, " value:"); if (len > 0) for (k = 0; k < len; k++) - fprintf (out, "%02x", (p->value)[k + len2]); + fprintf (out, "%02x", (unsigned) (p->value)[k + len2]); } break; case ASN1_ETYPE_OBJECT_ID: @@ -920,7 +922,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name, fprintf (out, " value:"); if (len2 > 0) for (k = 0; k < len2; k++) - fprintf (out, "%02x", (p->value)[k + len3]); + fprintf (out, "%02x", (unsigned) (p->value)[k + len3]); } break; case ASN1_ETYPE_SET: @@ -1017,7 +1019,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name, { while (1) { - p = _asn1_get_up (p); + p = _asn1_find_up (p); if (p == root) { p = NULL; |