summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_mark.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_mark.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_mark.c')
-rw-r--r--extensions/libxt_mark.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/extensions/libxt_mark.c b/extensions/libxt_mark.c
index 15b08b9a..d3c17277 100644
--- a/extensions/libxt_mark.c
+++ b/extensions/libxt_mark.c
@@ -86,9 +86,9 @@ mark_parse(int c, char **argv, int invert, unsigned int *flags,
static void print_mark(unsigned int mark, unsigned int mask)
{
if (mask != 0xffffffffU)
- printf("0x%x/0x%x ", mark, mask);
+ printf(" 0x%x/0x%x", mark, mask);
else
- printf("0x%x ", mark);
+ printf(" 0x%x", mark);
}
static void mark_mt_check(unsigned int flags)
@@ -103,9 +103,9 @@ mark_mt_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_mark_mtinfo1 *info = (const void *)match->data;
- printf("mark match ");
+ printf(" mark match");
if (info->invert)
- printf("!");
+ printf(" !");
print_mark(info->mark, info->mask);
}
@@ -114,10 +114,10 @@ mark_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_mark_info *info = (const void *)match->data;
- printf("MARK match ");
+ printf(" MARK match");
if (info->invert)
- printf("!");
+ printf(" !");
print_mark(info->mark, info->mask);
}
@@ -127,9 +127,9 @@ static void mark_mt_save(const void *ip, const struct xt_entry_match *match)
const struct xt_mark_mtinfo1 *info = (const void *)match->data;
if (info->invert)
- printf("! ");
+ printf(" !");
- printf("--mark ");
+ printf(" --mark");
print_mark(info->mark, info->mask);
}
@@ -139,9 +139,9 @@ mark_save(const void *ip, const struct xt_entry_match *match)
const struct xt_mark_info *info = (const void *)match->data;
if (info->invert)
- printf("! ");
+ printf(" !");
- printf("--mark ");
+ printf(" --mark");
print_mark(info->mark, info->mask);
}