Change the API for pb_make_string_substream() to use less stack.
If your own application uses this function, you have to change
the old style:
pb_istream_t substream;
if (!pb_make_string_substream(stream, &substream))
return false;
.. do stuff with substream ..
pb_close_string_substream(stream, &substream);
to the new style:
size_t remaining;
if (!pb_make_string_substream(stream, &remaining))
return false;
.. do stuff with stream ..
pb_close_string_substream(stream, remaining);
This commit is contained in:
@@ -128,8 +128,8 @@ bool pb_decode_fixed32(pb_istream_t *stream, void *dest);
|
||||
bool pb_decode_fixed64(pb_istream_t *stream, void *dest);
|
||||
|
||||
/* Make a limited-length substream for reading a PB_WT_STRING field. */
|
||||
bool pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream);
|
||||
void pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream);
|
||||
bool pb_make_string_substream(pb_istream_t *stream, size_t *remaining_length);
|
||||
void pb_close_string_substream(pb_istream_t *stream, size_t remaining_length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
Reference in New Issue
Block a user