Commit b0c2608d authored by Bi-Ruei, Chiu's avatar Bi-Ruei, Chiu Committed by Mouse

Fix issue 293 by handling default value with type ATV_BITVECTOR

1. Modify asn1p_y.c and asn1p_y.y to fix an error that
   function _convert_bitstring2binary() always return NULL.

2. Add handling for default value with type ATV_BITVECTOR in
   function try_inline_default().
parent 530a7996
......@@ -2409,7 +2409,7 @@ emit_default_string_value(arg_t *arg, asn1p_value_t *v) {
uint8_t *e = v->value.string.size + b;
OUT("{ ");
for(;b < e; b++)
OUT("0x%02x, ", *b);
OUT("0x%02X, ", *b);
OUT("0 };\n");
}
}
......@@ -2422,7 +2422,7 @@ emit_default_bitstring_value(arg_t *arg, asn1p_value_t *v) {
uint8_t *b = v->value.binary_vector.bits;
for (int i = 0; i < (v->value.binary_vector.size_in_bits + 7)/8; i++, b++) {
OUT("0x%02x", *b);
OUT("0x%02X", *b);
if(i < (v->value.binary_vector.size_in_bits + 7)/8 - 1)
OUT(", ");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment