Slightly simplify ofp10_match_to_string() by using ds_chomp()
rather than open-coding its logic.

Signed-off-by: Simon Horman <simon.hor...@netronome.com>
---
 lib/ofp-print.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 8dc7f06..d27d8a7 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -687,9 +687,7 @@ ofp10_match_to_string(const struct ofp10_match *om, int 
verbosity)
         print_wild(&f, "tp_dst=", w & OFPFW10_TP_DST, verbosity,
                    "%d", ntohs(om->tp_dst));
     }
-    if (ds_last(&f) == ',') {
-        f.length--;
-    }
+    ds_chomp(&f, ',');
     return ds_cstr(&f);
 }
 
-- 
2.1.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to