From 131d4fb53b45be85b1315f72f958cadf7b24a63f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 21 Aug 2011 13:16:16 +0200 Subject: libxt_string: simplify hex output routine Signed-off-by: Jan Engelhardt --- extensions/libxt_string.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'extensions') diff --git a/extensions/libxt_string.c b/extensions/libxt_string.c index 257f5f85..365019f7 100644 --- a/extensions/libxt_string.c +++ b/extensions/libxt_string.c @@ -230,13 +230,8 @@ print_hex_string(const char *str, const unsigned short int len) unsigned int i; /* start hex block */ printf(" \"|"); - for (i=0; i < len; i++) { - /* see if we need to prepend a zero */ - if ((unsigned char) str[i] <= 0x0F) - printf("0%x", (unsigned char) str[i]); - else - printf("%x", (unsigned char) str[i]); - } + for (i=0; i < len; i++) + printf("%02x", (unsigned char)str[i]); /* close hex block */ printf("|\""); } -- cgit v1.2.3