summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_u32.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2007-09-19 12:59:33 +0000
committerPatrick McHardy <kaber@trash.net>2007-09-19 12:59:33 +0000
commit55951a0532e35cf73bd83b01014387616eb31431 (patch)
tree7816cd93e6a6e27c6c8ea921d6129d50a5e90358 /extensions/libxt_u32.c
parent9640e529bd08c4c0458246fae0fd6b473c94ab46 (diff)
Fix u32 warnings
warning: format '%ld' expects type 'long int', but argument 3 has type 'int'. With %u alone, you would get "but arg-start is long" warnings on x64. With %lu, you would get "but arg-start is int" on x86. Fix it up by explicitly deciding for one (%u and cast to unsigned int) and using that. Jan Engelhardt <jengelh@computergmbh.de>
Diffstat (limited to 'extensions/libxt_u32.c')
-rw-r--r--extensions/libxt_u32.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/extensions/libxt_u32.c b/extensions/libxt_u32.c
index e2642f39..b1c6bcda 100644
--- a/extensions/libxt_u32.c
+++ b/extensions/libxt_u32.c
@@ -142,8 +142,8 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
if (testind > XT_U32_MAXSIZE)
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: too many \"&&\"s",
- arg - start);
+ "u32: at char %u: too many \"&&\"s",
+ (unsigned int)(arg - start));
return 1;
}
@@ -155,9 +155,9 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
if (*arg == '=') {
if (locind == 0) {
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: "
+ "u32: at char %u: "
"location spec missing",
- arg - start);
+ (unsigned int)(arg - start));
} else {
++arg;
state = 1;
@@ -170,18 +170,18 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
} else if (*arg == '<') {
if (*++arg != '<')
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: a second < expected", arg - start);
+ "u32: at char %u: a second '<' was expected", (unsigned int)(arg - start));
ct->location[locind].nextop = XT_U32_LEFTSH;
} else if (*arg == '>') {
if (*++arg != '>')
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: a second > expected", arg - start);
+ "u32: at char %u: a second '>' was expected", (unsigned int)(arg - start));
ct->location[locind].nextop = XT_U32_RIGHTSH;
} else if (*arg == '@') {
ct->location[locind].nextop = XT_U32_AT;
} else {
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: operator expected", arg - start);
+ "u32: at char %u: operator expected", (unsigned int)(arg - start));
}
++arg;
}
@@ -190,7 +190,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
parse_number(&arg, arg - start);
if (++locind > XT_U32_MAXSIZE)
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: too many operators", arg - start);
+ "u32: at char %u: too many operators", (unsigned int)(arg - start));
}
} else {
/*
@@ -201,17 +201,17 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
if (*arg == '&') {
if (*++arg != '&')
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: a second & was expected", arg - start);
+ "u32: at char %u: a second '&' was expected", (unsigned int)(arg - start));
if (valind == 0) {
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: value spec missing", arg - start);
+ "u32: at char %u: value spec missing", (unsigned int)(arg - start));
} else {
ct->nnums = locind;
ct->nvalues = valind;
ct = &data->tests[++testind];
if (testind > XT_U32_MAXSIZE)
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: too many \"&&\"s", arg - start);
+ "u32: at char %u: too many \"&&\"s", (unsigned int)(arg - start));
++arg;
state = 0;
locind = 0;
@@ -221,7 +221,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
if (valind > 0) { /* need , before number */
if (*arg != ',')
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: expected , or &&", arg - start);
+ "u32: at char %u: expected \",\" or \"&&\"", (unsigned int)(arg - start));
++arg;
}
ct->value[valind].min =
@@ -241,7 +241,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
if (++valind > XT_U32_MAXSIZE)
exit_error(PARAMETER_PROBLEM,
- "u32: at char %ld: too many \",\"s", arg - start);
+ "u32: at char %u: too many \",\"s", (unsigned int)(arg - start));
}
}
}