diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-06-03 16:35:45 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-06-04 10:06:53 +0200 |
commit | ecd1884be1d2e0f0063f82b0dd47ebe0231c3eb4 (patch) | |
tree | 4a2ae5b36296deb7a4529bfc5f7d781aa70707da | |
parent | 4f3b6264b2020dd831aec073369238749167149e (diff) | |
download | libtasn1-ecd1884be1d2e0f0063f82b0dd47ebe0231c3eb4.tar.gz libtasn1-ecd1884be1d2e0f0063f82b0dd47ebe0231c3eb4.tar.bz2 libtasn1-ecd1884be1d2e0f0063f82b0dd47ebe0231c3eb4.zip |
more efficient check for '?LAST' and error checking.
-rw-r--r-- | lib/parser_aux.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/parser_aux.c b/lib/parser_aux.c index effedb2..39e4046 100644 --- a/lib/parser_aux.c +++ b/lib/parser_aux.c @@ -170,13 +170,13 @@ asn1_find_node (asn1_node pointer, const char *name) return NULL; p = p->down; + if (p == NULL) + return NULL; /* The identifier "?LAST" indicates the last element in the right chain. */ - if (!strcmp (n, "?LAST")) + if (n[0] == '?' && n[1] == 'L') /* ?LAST */ { - if (p == NULL) - return NULL; while (p->right) p = p->right; } @@ -189,9 +189,9 @@ asn1_find_node (asn1_node pointer, const char *name) else p = p->right; } - if (p == NULL) - return NULL; } + if (p == NULL) + return NULL; } /* while */ return p; |