From b4ef34f5be162ffcfe53f5f5fa93541691161580 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 29 Jan 2008 13:43:35 +0000 Subject: use size_t Max Kellermann --- extensions/libxt_NFLOG.c | 9 +++++---- iptables-restore.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/extensions/libxt_NFLOG.c b/extensions/libxt_NFLOG.c index a9482376..e96878c5 100644 --- a/extensions/libxt_NFLOG.c +++ b/extensions/libxt_NFLOG.c @@ -45,6 +45,7 @@ static int NFLOG_parse(int c, char **argv, int invert, unsigned int *flags, { struct xt_nflog_info *info = (struct xt_nflog_info *)(*target)->data; int n; + size_t length; switch (c) { case NFLOG_GROUP: @@ -69,15 +70,15 @@ static int NFLOG_parse(int c, char **argv, int invert, unsigned int *flags, exit_error(PARAMETER_PROBLEM, "Unexpected `!' after --nflog-prefix"); - n = strlen(optarg); - if (n == 0) + length = strlen(optarg); + if (length == 0) exit_error(PARAMETER_PROBLEM, "No prefix specified for --nflog-prefix"); - if (n >= sizeof(info->prefix)) + if (length >= sizeof(info->prefix)) exit_error(PARAMETER_PROBLEM, "--nflog-prefix too long, max %Zu characters", sizeof(info->prefix) - 1); - if (n != strlen(strtok(optarg, "\n"))) + if (length != strlen(strtok(optarg, "\n"))) exit_error(PARAMETER_PROBLEM, "Newlines are not allowed in --nflog-prefix"); strcpy(info->prefix, optarg); diff --git a/iptables-restore.c b/iptables-restore.c index dc82f1dd..ade1a2fe 100644 --- a/iptables-restore.c +++ b/iptables-restore.c @@ -320,7 +320,7 @@ main(int argc, char *argv[]) /* the parser */ char *curchar; int quote_open; - int param_len; + size_t param_len; /* reset the newargv */ newargc = 0; -- cgit v1.2.3