aboutsummaryrefslogtreecommitdiffstats
path: root/src/NativeEnumerated.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-07-20 00:03:44 +0200
committerHarald Welte <laforge@gnumonks.org>2010-07-20 00:03:44 +0200
commitec0e217b0647eb798576a7d3366b39c159c00624 (patch)
tree88404309798e2fac2844b4e76224b6ad1d7c5375 /src/NativeEnumerated.c
parentb1e3ee75318536dac0a91817c5e4d35d61893ba6 (diff)
Update to asn1c official repository svn trunk r1409
Diffstat (limited to 'src/NativeEnumerated.c')
-rw-r--r--src/NativeEnumerated.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/NativeEnumerated.c b/src/NativeEnumerated.c
index e3af1ca..1554220 100644
--- a/src/NativeEnumerated.c
+++ b/src/NativeEnumerated.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Copyright (c) 2004, 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
/*
@@ -177,9 +177,9 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td,
inext = 1;
}
if(ct->flags & APC_EXTENSIBLE) {
- if(per_put_few_bits(po, inext, 0))
+ if(per_put_few_bits(po, inext, 1))
_ASN_ENCODE_FAILED;
- ct = 0;
+ if(inext) ct = 0;
} else if(inext) {
_ASN_ENCODE_FAILED;
}
@@ -196,7 +196,10 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td,
/*
* X.691, #10.6: normally small non-negative whole number;
*/
- if(uper_put_nsnnwn(po, value - (specs->extension - 1)))
+ ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
+ value, specs->extension, inext,
+ value - (inext ? (specs->extension - 1) : 0));
+ if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
_ASN_ENCODE_FAILED;
_ASN_ENCODED_OK(er);