From 73866357e4a7a0fdc1b293bf8863fee2bd56da9e Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 18 Dec 2010 02:04:59 +0100 Subject: iptables: do not print trailing whitespaces Due to the use of printf("foobar "), iptables emits spaces at the end-of-line, which looks odd to some users because it causes the terminal to wrap even if there is seemingly nothing to print. It may also have other points of annoyance, such as mailers interpreting a trailing space as an indicator that the paragraph continues when format=flowed is also on. And git highlights trailing spaces in red, so let's avoid :) Preexisting inconsistencies in outputting spaces in the right spot are also addressed right away. References: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=429579 Signed-off-by: Jan Engelhardt --- extensions/libipt_TTL.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'extensions/libipt_TTL.c') diff --git a/extensions/libipt_TTL.c b/extensions/libipt_TTL.c index c8e55242..f13d9c34 100644 --- a/extensions/libipt_TTL.c +++ b/extensions/libipt_TTL.c @@ -93,17 +93,17 @@ static void TTL_save(const void *ip, const struct xt_entry_target *target) switch (info->mode) { case IPT_TTL_SET: - printf("--ttl-set "); + printf(" --ttl-set"); break; case IPT_TTL_DEC: - printf("--ttl-dec "); + printf(" --ttl-dec"); break; case IPT_TTL_INC: - printf("--ttl-inc "); + printf(" --ttl-inc"); break; } - printf("%u ", info->ttl); + printf(" %u", info->ttl); } static void TTL_print(const void *ip, const struct xt_entry_target *target, @@ -112,19 +112,19 @@ static void TTL_print(const void *ip, const struct xt_entry_target *target, const struct ipt_TTL_info *info = (struct ipt_TTL_info *) target->data; - printf("TTL "); + printf(" TTL "); switch (info->mode) { case IPT_TTL_SET: - printf("set to "); + printf("set to"); break; case IPT_TTL_DEC: - printf("decrement by "); + printf("decrement by"); break; case IPT_TTL_INC: - printf("increment by "); + printf("increment by"); break; } - printf("%u ", info->ttl); + printf(" %u", info->ttl); } static const struct option TTL_opts[] = { -- cgit v1.2.3