summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libxt_string.c')
-rw-r--r--extensions/libxt_string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/libxt_string.c b/extensions/libxt_string.c
index 365019f7..472035fb 100644
--- a/extensions/libxt_string.c
+++ b/extensions/libxt_string.c
@@ -218,7 +218,7 @@ is_hex_string(const char *str, const unsigned short int len)
if (! isprint(str[i]))
return 1; /* string contains at least one non-printable char */
/* use hex output if the last char is a "\" */
- if ((unsigned char) str[len-1] == 0x5c)
+ if (str[len-1] == '\\')
return 1;
return 0;
}
@@ -242,8 +242,8 @@ print_string(const char *str, const unsigned short int len)
unsigned int i;
printf(" \"");
for (i=0; i < len; i++) {
- if ((unsigned char) str[i] == 0x22) /* escape any embedded quotes */
- printf("%c", 0x5c);
+ if (str[i] == '\"') /* escape any embedded quotes */
+ putchar('\\');
printf("%c", (unsigned char) str[i]);
}
printf("\""); /* closing quote */