diff options
author | Robbie Shade <rjshade@google.com> | 2018-01-09 21:06:23 +0300 |
---|---|---|
committer | Robbie Shade <rjshade@google.com> | 2018-01-09 21:06:23 +0300 |
commit | 9b7476c7c3631dd4453a27b526f8b5299ad078ac (patch) | |
tree | 8363b2e4b2eb67ea96811e79180a19f93c8ba2e1 /pb_decode.c | |
parent | 93da435058518bbf49cc393e1805d483ce160b1b (diff) |
Explicitly handle all enum values in switch
Diffstat (limited to 'pb_decode.c')
-rw-r--r-- | pb_decode.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pb_decode.c b/pb_decode.c index dc344dc..6223bea 100644 --- a/pb_decode.c +++ b/pb_decode.c @@ -351,6 +351,11 @@ static bool checkreturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire *size = 4; return pb_read(stream, buf, 4); + case PB_WT_STRING: + // Calling read_raw_value with a PB_WT_STRING is an error. + // Explicitly handle this case and fallthrough to default to avoid + // compiler warnings. + default: PB_RETURN_ERROR(stream, "invalid wire_type"); } } |