aboutsummaryrefslogtreecommitdiff
path: root/pb_encode.c
diff options
context:
space:
mode:
Diffstat (limited to 'pb_encode.c')
-rw-r--r--pb_encode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pb_encode.c b/pb_encode.c
index 089172c..d0129e6 100644
--- a/pb_encode.c
+++ b/pb_encode.c
@@ -232,7 +232,7 @@ static bool pb_check_proto3_default_value(const pb_field_t *field, const void *p
/* Oneof fields */
return *(const pb_size_t*)pSize == 0;
}
- else if (PB_HTYPE(type) == PB_HTYPE_OPTIONAL && field->size_offset)
+ else if (PB_HTYPE(type) == PB_HTYPE_OPTIONAL && field->size_offset != 0)
{
/* Proto2 optional fields inside proto3 submessage */
return *(const bool*)pSize == false;