From 6a022985845a0a50b32b7c1fb22f9aee1f675825 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Mon, 8 Apr 2013 11:00:28 +0300 Subject: [PATCH] Avoid maybe-uninitialized warning Patch from dch. --- pb_decode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pb_decode.c b/pb_decode.c index e727f334..7eda89a4 100644 --- a/pb_decode.c +++ b/pb_decode.c @@ -664,7 +664,8 @@ bool pb_decode_fixed64(pb_istream_t *stream, void *dest) bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_t *field, void *dest) { uint64_t value; - bool status = pb_decode_varint(stream, &value); + if (!pb_decode_varint(stream, &value)) + return false; switch (field->data_size) { @@ -675,13 +676,14 @@ bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_t *field, vo default: PB_RETURN_ERROR(stream, "invalid data_size"); } - return status; + return true; } bool checkreturn pb_dec_svarint(pb_istream_t *stream, const pb_field_t *field, void *dest) { int64_t value; - bool status = pb_decode_svarint(stream, &value); + if (!pb_decode_svarint(stream, &value)) + return false; switch (field->data_size) { @@ -690,7 +692,7 @@ bool checkreturn pb_dec_svarint(pb_istream_t *stream, const pb_field_t *field, v default: PB_RETURN_ERROR(stream, "invalid data_size"); } - return status; + return true; } bool checkreturn pb_dec_fixed32(pb_istream_t *stream, const pb_field_t *field, void *dest) -- 2.16.6