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:
committed by
Petteri Aimonen
parent
1f8fb1f1ed
commit
068de05c51
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user