Code Review
/
apps
/
low-level-can-service.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
ef07635
)
Fix missing error messages in pb_encode.c
author
Petteri Aimonen
<jpa@git.mail.kapsi.fi>
Sun, 29 Dec 2013 16:34:57 +0000
(18:34 +0200)
committer
Petteri Aimonen
<jpa@git.mail.kapsi.fi>
Sun, 29 Dec 2013 16:35:57 +0000
(18:35 +0200)
pb_encode.c
patch
|
blob
|
history
diff --git
a/pb_encode.c
b/pb_encode.c
index
476b111
..
c2d0e2c
100644
(file)
--- a/
pb_encode.c
+++ b/
pb_encode.c
@@
-226,7
+226,7
@@
static bool checkreturn encode_basic_field(pb_ostream_t *stream,
{
case PB_HTYPE_REQUIRED:
if (!pData)
-
return false
;
+
PB_RETURN_ERROR(stream, "missing required field")
;
if (!pb_encode_tag_for_field(stream, field))
return false;
if (!func(stream, field, pData))
@@
-499,7
+499,12
@@
bool checkreturn pb_encode_submessage(pb_ostream_t *stream, const pb_field_t fie
bool status;
if (!pb_encode(&substream, fields, src_struct))
+ {
+#ifndef PB_NO_ERRMSG
+ stream->errmsg = substream.errmsg;
+#endif
return false;
+ }
size = substream.bytes_written;