summaryrefslogtreecommitdiffstats
path: root/extensions/libip6t_ah.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/libip6t_ah.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/libip6t_ah.c')
-rw-r--r--extensions/libip6t_ah.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/extensions/libip6t_ah.c b/extensions/libip6t_ah.c
index 839f14d6..693a4f8f 100644
--- a/extensions/libip6t_ah.c
+++ b/extensions/libip6t_ah.c
@@ -123,9 +123,9 @@ print_spis(const char *name, uint32_t min, uint32_t max,
if (min != 0 || max != 0xFFFFFFFF || invert) {
if (min == max)
- printf("%s:%s%u ", name, inv, min);
+ printf("%s:%s%u", name, inv, min);
else
- printf("%ss:%s%u:%u ", name, inv, min, max);
+ printf("%ss:%s%u:%u", name, inv, min, max);
}
}
@@ -135,7 +135,7 @@ print_len(const char *name, uint32_t len, int invert)
const char *inv = invert ? "!" : "";
if (len != 0 || invert)
- printf("%s:%s%u ", name, inv, len);
+ printf("%s:%s%u", name, inv, len);
}
static void ah_print(const void *ip, const struct xt_entry_match *match,
@@ -143,17 +143,17 @@ static void ah_print(const void *ip, const struct xt_entry_match *match,
{
const struct ip6t_ah *ah = (struct ip6t_ah *)match->data;
- printf("ah ");
+ printf(" ah ");
print_spis("spi", ah->spis[0], ah->spis[1],
ah->invflags & IP6T_AH_INV_SPI);
print_len("length", ah->hdrlen,
ah->invflags & IP6T_AH_INV_LEN);
if (ah->hdrres)
- printf("reserved ");
+ printf(" reserved");
if (ah->invflags & ~IP6T_AH_INV_MASK)
- printf("Unknown invflags: 0x%X ",
+ printf(" Unknown invflags: 0x%X",
ah->invflags & ~IP6T_AH_INV_MASK);
}
@@ -163,26 +163,26 @@ static void ah_save(const void *ip, const struct xt_entry_match *match)
if (!(ahinfo->spis[0] == 0
&& ahinfo->spis[1] == 0xFFFFFFFF)) {
- printf("%s--ahspi ",
- (ahinfo->invflags & IP6T_AH_INV_SPI) ? "! " : "");
+ printf("%s --ahspi ",
+ (ahinfo->invflags & IP6T_AH_INV_SPI) ? " !" : "");
if (ahinfo->spis[0]
!= ahinfo->spis[1])
- printf("%u:%u ",
+ printf("%u:%u",
ahinfo->spis[0],
ahinfo->spis[1]);
else
- printf("%u ",
+ printf("%u",
ahinfo->spis[0]);
}
if (ahinfo->hdrlen != 0 || (ahinfo->invflags & IP6T_AH_INV_LEN) ) {
- printf("%s--ahlen %u ",
- (ahinfo->invflags & IP6T_AH_INV_LEN) ? "! " : "",
+ printf("%s --ahlen %u",
+ (ahinfo->invflags & IP6T_AH_INV_LEN) ? " !" : "",
ahinfo->hdrlen);
}
if (ahinfo->hdrres != 0 )
- printf("--ahres ");
+ printf(" --ahres");
}
static struct xtables_match ah_mt6_reg = {