diff options
Diffstat (limited to 'pb_encode.c')
-rw-r--r-- | pb_encode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pb_encode.c b/pb_encode.c index 221c0ea..64b62b4 100644 --- a/pb_encode.c +++ b/pb_encode.c @@ -100,7 +100,7 @@ pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize) bool checkreturn pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count) { - if (stream->callback != NULL) + if (count > 0 && stream->callback != NULL) { if (stream->bytes_written + count > stream->max_size) PB_RETURN_ERROR(stream, "stream full"); |