From: Ben Pfaff Date: Tue, 11 Jan 2011 23:35:56 +0000 (-0800) Subject: odp-util: Improve formatting of bogus empty action attributes. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3476fce34e05af370e90961a9df4d237d6ca2e51;p=openvswitch odp-util: Improve formatting of bogus empty action attributes. Before this change, these were formatted as: ,***%u leftover bytes*** After this change, they are formatted as: ,***%u leftover bytes*** Reviewed by Ethan Jackson . --- diff --git a/lib/odp-util.c b/lib/odp-util.c index 29f536da..dc6843fb 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010 Nicira Networks. + * Copyright (c) 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -187,6 +187,9 @@ format_odp_actions(struct ds *ds, const struct nlattr *actions, format_odp_action(ds, a); } if (left) { + if (left == actions_len) { + ds_put_cstr(ds, ""); + } ds_put_format(ds, " ***%u leftover bytes***", left); } } else {