summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Steinhauser <jens.steinhauser@gmail.com>2012-11-27 00:19:55 +0100
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-11-27 19:55:21 +0200
commit068de05c51b7b46e33ef87b8d78c9dda6704abc8 (patch)
tree969c25f4a489070cf382ab4ecda0dd3995959de2
parent1f8fb1f1ed3dbb606241db191bc3c0b5683fd4a8 (diff)
Complete initialization of pb_istream_t.
Because PB_RETURN_ERROR checks if the 'errmsg' member is NULL before assigning to it, error messages would get lost.
-rw-r--r--pb_decode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pb_decode.c b/pb_decode.c
index 8e01fd7a..c9652afb 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -80,6 +80,9 @@ pb_istream_t pb_istream_from_buffer(uint8_t *buf, size_t bufsize)
stream.callback = &buf_read;
stream.state = buf;
stream.bytes_left = bufsize;
+#ifndef PB_NO_ERRMSG
+ stream.errmsg = NULL;
+#endif
return stream;
}