fix printing arrays
This commit is contained in:
parent
eaa1d434a0
commit
4198e0a819
1 changed files with 15 additions and 9 deletions
|
@ -35,9 +35,11 @@ static void tag_print_data(const tag_t *tag, int depth) {
|
|||
break;
|
||||
case TAG_BYTE_ARRAY:
|
||||
printf("[");
|
||||
for (int32_t i = 0; i < tag->data.b_arr.size; i++)
|
||||
printf("%hhd,", tag->data.b_arr.data[i]);
|
||||
printf("\b]");
|
||||
for (int32_t i = 0; i < tag->data.b_arr.size; i++) {
|
||||
if (i != 0) printf(",");
|
||||
printf("%hhd", tag->data.b_arr.data[i]);
|
||||
}
|
||||
printf("]");
|
||||
break;
|
||||
case TAG_STRING:
|
||||
if (tag->data.string.size > 1)
|
||||
|
@ -65,15 +67,19 @@ static void tag_print_data(const tag_t *tag, int depth) {
|
|||
break;
|
||||
case TAG_INT_ARRAY:
|
||||
printi(depth, "[");
|
||||
for (int32_t i = 0; i < tag->data.i_arr.size; i++)
|
||||
printf("%d,", tag->data.i_arr.data[i]);
|
||||
printf("\b]");
|
||||
for (int32_t i = 0; i < tag->data.i_arr.size; i++) {
|
||||
if (i != 0) printf(",");
|
||||
printf("%d", tag->data.i_arr.data[i]);
|
||||
}
|
||||
printf("]");
|
||||
break;
|
||||
case TAG_LONG_ARRAY:
|
||||
printf("[");
|
||||
for (int32_t i = 0; i < tag->data.l_arr.size; i++)
|
||||
printf("%ld,", tag->data.l_arr.data[i]);
|
||||
printf("\b]");
|
||||
for (int32_t i = 0; i < tag->data.l_arr.size; i++) {
|
||||
if (i != 0) printf(",");
|
||||
printf("%ld", tag->data.l_arr.data[i]);
|
||||
}
|
||||
printf("]");
|
||||
break;
|
||||
case TAG_END:
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue