aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--skeletons/NativeEnumerated.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/skeletons/NativeEnumerated.c b/skeletons/NativeEnumerated.c
index e3af1ca4..12b079e1 100644
--- a/skeletons/NativeEnumerated.c
+++ b/skeletons/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,7 +177,7 @@ 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;
} else if(inext) {
@@ -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 = %d, ext = %d, inext = %d, res = %d",
+ 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);