[CRIU] [PATCH] protobuf: skip show of zero-size repeated fields
Kinsbursky Stanislav
skinsbursky at openvz.org
Tue Nov 6 07:20:10 EST 2012
From: Stanislav Kinsbursky <skinsbursky at openvz.org>
Print "<empty>" message for such filed instead.
http://bugzilla.openvz.org/show_bug.cgi?id=2425
Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
protobuf.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
-------------- next part --------------
diff --git a/protobuf.c b/protobuf.c
index cf86297..7f76e13 100644
--- a/protobuf.c
+++ b/protobuf.c
@@ -405,6 +405,11 @@ static void pb_show_repeated(pb_pr_ctl_t *ctl, int nr_fields, pb_pr_show_t show,
unsigned long counter;
int done;
+ if (nr_fields == 0) {
+ pr_msg("<empty>");
+ return;
+ }
+
field->count = nr_fields;
done = show(field);
if (done)
More information about the CRIU
mailing list