aboutsummaryrefslogtreecommitdiffstats
path: root/pb_decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'pb_decode.c')
-rw-r--r--pb_decode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pb_decode.c b/pb_decode.c
index c533698..a079556 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -308,12 +308,12 @@ static bool pb_field_next(pb_field_iterator_t *iter)
prev_size *= iter->pos->array_size;
}
- if (PB_HTYPE(iter->pos->type) == PB_HTYPE_REQUIRED)
- iter->required_field_index++;
-
if (iter->pos->tag == 0)
return false; /* Only happens with empty message types */
+ if (PB_HTYPE(iter->pos->type) == PB_HTYPE_REQUIRED)
+ iter->required_field_index++;
+
iter->pos++;
iter->field_index++;
if (iter->pos->tag == 0)