Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
24a97d6
)
VPP-904: fixes zero length CLI parameters parse
08/7508/1
author
Alexander Kotov
<kot@yandex.ru>
Mon, 10 Jul 2017 15:23:31 +0000
(18:23 +0300)
committer
Chris Luke
<chris_luke@comcast.com>
Mon, 10 Jul 2017 17:04:35 +0000
(17:04 +0000)
Change-Id: I21fbc9aff2b97a8b3f4cbed202c00b6d84557a6e
Signed-off-by: Alexander Kotov <kot@yandex.ru>
(cherry picked from commit
28160f38488743b8cee0a7bd62b432a9dd8f4bfd
)
src/vppinfra/unformat.c
patch
|
blob
|
history
diff --git
a/src/vppinfra/unformat.c
b/src/vppinfra/unformat.c
index
f626f05
..
5b17562
100644
(file)
--- a/
src/vppinfra/unformat.c
+++ b/
src/vppinfra/unformat.c
@@
-401,7
+401,7
@@
unformat_line (unformat_input_t * i, va_list * va)
}
*result = line;
- return
1
;
+ return
vec_len (line)
;
}
/* Parse a line ending with \n and return it as an unformat_input_t. */
@@
-410,7
+410,8
@@
unformat_line_input (unformat_input_t * i, va_list * va)
{
unformat_input_t *result = va_arg (*va, unformat_input_t *);
u8 *line;
- unformat_user (i, unformat_line, &line);
+ if (!unformat_user (i, unformat_line, &line))
+ return 0;
unformat_init_vector (result, line);
return 1;
}