diff options
author | Lev Walkin <vlm@lionet.info> | 2006-09-18 20:05:55 +0000 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2006-09-18 20:05:55 +0000 |
commit | 0a8aa6043f01268efe03bade3688d50249129bc1 (patch) | |
tree | 99317b3d03080ca0332b711d949a6892a9ec7cab /skeletons/constr_SET_OF.c | |
parent | 5a621d6a521599d478f0b3da72c6668bb2eaad89 (diff) |
per encoding support
Diffstat (limited to 'skeletons/constr_SET_OF.c')
-rw-r--r-- | skeletons/constr_SET_OF.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c index 03c6fe28..09f27db5 100644 --- a/skeletons/constr_SET_OF.c +++ b/skeletons/constr_SET_OF.c @@ -883,7 +883,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(ct && ct->flags & APC_EXTENSIBLE) { int value = per_get_few_bits(pd, 1); - if(value < 0) _ASN_DECODE_FAILED; + if(value < 0) _ASN_DECODE_STARVED; if(value) ct = 0; /* Not restricted! */ } @@ -892,7 +892,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, nelems = per_get_few_bits(pd, ct->effective_bits); ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s", (long)nelems, ct->lower_bound, td->name); - if(nelems < 0) _ASN_DECODE_FAILED; + if(nelems < 0) _ASN_DECODE_STARVED; nelems += ct->lower_bound; } else { nelems = -1; @@ -905,7 +905,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ct ? ct->effective_bits : -1, &repeat); ASN_DEBUG("Got to decode %d elements (eff %d)", (int)nelems, (int)ct ? ct->effective_bits : -1); - if(nelems < 0) _ASN_DECODE_FAILED; + if(nelems < 0) _ASN_DECODE_STARVED; } for(i = 0; i < nelems; i++) { @@ -921,12 +921,13 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ASN_DEBUG("Failed to add element into %s", td->name); /* Fall through */ + rv.code == RC_FAIL; } else { ASN_DEBUG("Failed decoding %s of %s (SET OF)", elm->type->name, td->name); } if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); - _ASN_DECODE_FAILED; + return rv; } nelems = -1; /* Allow uper_get_length() */ |