bfd: Delete trailing whitespace in 'bfd/show' output.
authorAlex Wang <alexw@nicira.com>
Tue, 13 Aug 2013 17:02:41 +0000 (10:02 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 13 Aug 2013 16:54:17 +0000 (09:54 -0700)
This commit chops off the trailing whitespace in the 'flag' field
of 'bfd/show' output.  This is for the string matching in bfd
unit test.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/bfd.c

index 81fd178..7c7c0b7 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -782,6 +782,8 @@ bfd_flag_str(enum flags flags)
         ds_put_cstr(&ds, "poll ");
     }
 
+    /* Do not copy the trailing whitespace. */
+    ds_chomp(&ds, ' ');
     ovs_strlcpy(flag_str, ds_cstr(&ds), sizeof flag_str);
     ds_destroy(&ds);
     return flag_str;