summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_tos.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-12-18 02:04:59 +0100
committerJan Engelhardt <jengelh@medozas.de>2011-01-31 03:05:34 +0100
commit73866357e4a7a0fdc1b293bf8863fee2bd56da9e (patch)
tree1890725e5f327ba14ccf452ff9e5916954d7908f /extensions/libxt_tos.c
parentbb8be30857edd501e701c2f22db6c59bd6839c87 (diff)
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 <jengelh@medozas.de>
Diffstat (limited to 'extensions/libxt_tos.c')
-rw-r--r--extensions/libxt_tos.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/extensions/libxt_tos.c b/extensions/libxt_tos.c
index 435f68e8..8b83e180 100644
--- a/extensions/libxt_tos.c
+++ b/extensions/libxt_tos.c
@@ -103,11 +103,11 @@ static void tos_mt_print_v0(const void *ip, const struct xt_entry_match *match,
{
const struct ipt_tos_info *info = (const void *)match->data;
- printf("tos match ");
+ printf(" tos match ");
if (info->invert)
printf("!");
if (numeric || !tos_try_print_symbolic("", info->tos, 0x3F))
- printf("0x%02x ", info->tos);
+ printf("0x%02x", info->tos);
}
static void tos_mt_print(const void *ip, const struct xt_entry_match *match,
@@ -115,12 +115,12 @@ static void tos_mt_print(const void *ip, const struct xt_entry_match *match,
{
const struct xt_tos_match_info *info = (const void *)match->data;
- printf("tos match ");
+ printf(" tos match");
if (info->invert)
printf("!");
if (numeric ||
!tos_try_print_symbolic("", info->tos_value, info->tos_mask))
- printf("0x%02x/0x%02x ", info->tos_value, info->tos_mask);
+ printf("0x%02x/0x%02x", info->tos_value, info->tos_mask);
}
static void tos_mt_save_v0(const void *ip, const struct xt_entry_match *match)
@@ -128,8 +128,8 @@ static void tos_mt_save_v0(const void *ip, const struct xt_entry_match *match)
const struct ipt_tos_info *info = (const void *)match->data;
if (info->invert)
- printf("! ");
- printf("--tos 0x%02x ", info->tos);
+ printf(" !");
+ printf(" --tos 0x%02x", info->tos);
}
static void tos_mt_save(const void *ip, const struct xt_entry_match *match)
@@ -137,8 +137,8 @@ static void tos_mt_save(const void *ip, const struct xt_entry_match *match)
const struct xt_tos_match_info *info = (const void *)match->data;
if (info->invert)
- printf("! ");
- printf("--tos 0x%02x/0x%02x ", info->tos_value, info->tos_mask);
+ printf(" !");
+ printf(" --tos 0x%02x/0x%02x", info->tos_value, info->tos_mask);
}
static struct xtables_match tos_mt_reg[] = {