aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/constr_SET_OF_oer.c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2017-09-13 22:24:35 +0000
committerLev Walkin <vlm@lionet.info>2017-09-13 22:24:35 +0000
commiteff98a506ca858baa378b68a413ca3c705e865ef (patch)
tree221e10cb1d71875ddc1f554ba4f7d86af8351c51 /skeletons/constr_SET_OF_oer.c
parentdfbff614e3f4397e35447b581bd2f42d3d42f30b (diff)
fixed under freebsd and clang
Diffstat (limited to 'skeletons/constr_SET_OF_oer.c')
-rw-r--r--skeletons/constr_SET_OF_oer.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/skeletons/constr_SET_OF_oer.c b/skeletons/constr_SET_OF_oer.c
index 8cbf81fe..49f56c51 100644
--- a/skeletons/constr_SET_OF_oer.c
+++ b/skeletons/constr_SET_OF_oer.c
@@ -63,6 +63,8 @@
*/
static ssize_t
oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) {
+ const uint8_t *b;
+ const uint8_t *bend;
size_t len = 0;
size_t qty;
@@ -77,15 +79,13 @@ oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) {
return 0;
}
- const uint8_t *b = (const uint8_t *)ptr + len_len;
- const uint8_t *bend = b + len;
-
+ b = (const uint8_t *)ptr + len_len;
+ bend = b + len;
/* Skip the leading 0-bytes */
for(; b < bend && *b == 0; b++) {
}
-
if((bend - b) > (ssize_t)sizeof(size_t)) {
/* Length is not representable by the native size_t type */
*qty_r = 0;
@@ -261,8 +261,9 @@ SET_OF_encode_oer(asn_TYPE_descriptor_t *td,
}
{
- asn_enc_rval_t erval = {computed_size, 0, 0};
- return erval;
+ asn_enc_rval_t erval;
+ erval.encoded = computed_size;
+ ASN__ENCODED_OK(erval);
}
}