This commit truncates the trailing whitespace in the 'flag' field out 'bfd/show' output. This is for the string matching in bfd unit test.
Signed-off-by: Alex Wang <al...@nicira.com> --- lib/bfd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bfd.c b/lib/bfd.c index 0a0089b..0af0eeb 100644 --- a/lib/bfd.c +++ b/lib/bfd.c @@ -866,7 +866,8 @@ bfd_flag_str(enum flags flags) ds_put_cstr(&ds, "poll "); } - ovs_strlcpy(flag_str, ds_cstr(&ds), sizeof flag_str); + /* Do not copy the trailing whitespace. */ + ovs_strlcpy(flag_str, ds_cstr(&ds), ds.length); ds_destroy(&ds); return flag_str; } -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev