From: Jens Steinhauser Date: Mon, 26 Nov 2012 23:19:55 +0000 (+0100) Subject: Complete initialization of pb_istream_t. X-Git-Tag: 5.0.2~186^2~434 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;ds=sidebyside;h=068de05c51b7b46e33ef87b8d78c9dda6704abc8;hp=1f8fb1f1ed3dbb606241db191bc3c0b5683fd4a8;p=apps%2Fagl-service-can-low-level.git 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. --- 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; }