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.
This commit is contained in:
Jens Steinhauser
2012-11-27 00:19:55 +01:00
committed by Petteri Aimonen
parent 1f8fb1f1ed
commit 068de05c51

View File

@@ -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;
}