diff --git a/asn1c/unber.c b/asn1c/unber.c index 69736988c659fcb0f2f477ead48ef46d19667832..87337685d6da8cacf78feb3c10273f2b21141f3a 100644 --- a/asn1c/unber.c +++ b/asn1c/unber.c @@ -27,12 +27,15 @@ */ #include "sys-common.h" +#define ASN_DISABLE_PER_SUPPORT 1 + #include <asn1parser.h> /* For static string tables */ #include <asn_application.h> #include <constraints.c> #include <ber_tlv_tag.c> #include <ber_tlv_length.c> +#include <INTEGER.c> #include <OBJECT_IDENTIFIER.c> #include <RELATIVE-OID.c> #include <asn_codecs_prim.c> @@ -392,7 +395,7 @@ print_TL(int fin, asn1c_integer_t offset, int level, int constr, ssize_t tlen, b return; } - while(level-- > 0) printf(indent_bytes); /* Print indent */ + while(level-- > 0) fputs(indent_bytes, stdout); /* Print indent */ printf(fin ? "</" : "<"); printf(constr ? ((tlv_len == -1) ? "I" : "C") : "P"); diff --git a/skeletons/INTEGER.c b/skeletons/INTEGER.c index 01990edad0a8d2bca7394f5f307ee952e92bf64d..05eae8b057d7b207c4f35492d7c47f3896ba6a9d 100644 --- a/skeletons/INTEGER.c +++ b/skeletons/INTEGER.c @@ -24,8 +24,13 @@ asn_TYPE_descriptor_t asn_DEF_INTEGER = { INTEGER_encode_der, INTEGER_decode_xer, INTEGER_encode_xer, +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else INTEGER_decode_uper, /* Unaligned PER decoder */ INTEGER_encode_uper, /* Unaligned PER encoder */ +#endif /* ASN_DISABLE_PER_SUPPORT */ 0, /* Use generic outmost tag fetcher */ asn_DEF_INTEGER_tags, sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), @@ -557,6 +562,8 @@ INTEGER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, _ASN_ENCODED_OK(er); } +#ifndef ASN_DISABLE_PER_SUPPORT + asn_dec_rval_t INTEGER_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { @@ -765,6 +772,8 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td, _ASN_ENCODED_OK(er); } +#endif /* ASN_DISABLE_PER_SUPPORT */ + int asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) { uint8_t *b, *end;