summaryrefslogtreecommitdiff
path: root/lib/structure.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-09-12 22:19:08 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-09-12 22:19:08 +0200
commit7ddf0590e6310af489228f21fbf6c30de89c8c04 (patch)
treee404c2ee54fc9f17e24d3b6a8ab3e1f5dacf9fb7 /lib/structure.c
parentf21ac35f6ea131cef3ce3636aa6da7851c81762b (diff)
downloadlibtasn1-7ddf0590e6310af489228f21fbf6c30de89c8c04.tar.gz
name is now a statically allocated string and other optimizations.
Diffstat (limited to 'lib/structure.c')
-rw-r--r--lib/structure.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/structure.c b/lib/structure.c
index e4fe600..93da56c 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -104,7 +104,7 @@ _asn1_create_static_structure (ASN1_TYPE pointer, char *output_file_name,
{
fprintf (file, " { ");
- if (p->name)
+ if (p->name[0] != 0)
fprintf (file, "\"%s\", ", p->name);
else
fprintf (file, "NULL, ");
@@ -391,7 +391,7 @@ _asn1_copy_structure3 (ASN1_TYPE source_node)
{
if (move != UP)
{
- if (p_s->name)
+ if (p_s->name[0] != 0)
_asn1_set_name (p_d, p_s->name);
if (p_s->value)
_asn1_set_value (p_d, p_s->value, p_s->value_len);
@@ -708,7 +708,7 @@ asn1_print_structure (FILE * out, ASN1_TYPE structure, const char *name,
for (k = 0; k < indent; k++)
fprintf (out, " ");
fprintf (out, "name:");
- if (p->name)
+ if (p->name[0] != 0)
fprintf (out, "%s ", p->name);
else
fprintf (out, "NULL ");
@@ -725,7 +725,7 @@ asn1_print_structure (FILE * out, ASN1_TYPE structure, const char *name,
for (k = 0; k < indent; k++)
fprintf (out, " ");
fprintf (out, "name:");
- if (p->name)
+ if (p->name[0] != 0)
fprintf (out, "%s ", p->name);
else
fprintf (out, "NULL ");
@@ -1067,7 +1067,7 @@ asn1_number_of_elements (ASN1_TYPE element, const char *name, int *num)
while (p)
{
- if ((p->name) && (p->name[0] == '?'))
+ if (p->name[0] == '?')
(*num)++;
p = p->right;
}