diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-04-08 11:00:28 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-04-08 11:00:28 +0300 |
commit | 6a022985845a0a50b32b7c1fb22f9aee1f675825 (patch) | |
tree | 409df1f00b4099f18b98276e87c398e568110fea | |
parent | a968233777e0781cfd3dd7b9566b631dc576fed1 (diff) |
Avoid maybe-uninitialized warning
Patch from dch.
-rw-r--r-- | pb_decode.c | 10 |
1 files 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) |