All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Haller <thaller@redhat.com>
To: NetFilter <netfilter-devel@vger.kernel.org>
Cc: Thomas Haller <thaller@redhat.com>
Subject: [PATCH nft 3/3] parser: use size_t type for strlen() results
Date: Thu,  9 Nov 2023 19:59:49 +0100	[thread overview]
Message-ID: <20231109190032.669575-3-thaller@redhat.com> (raw)
In-Reply-To: <20231109190032.669575-1-thaller@redhat.com>

strlen() has a "size_t" as result. Use the correct type.

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 src/parser_bison.y | 2 +-
 src/scanner.l      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index ca0851c915d2..12031c831353 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -150,7 +150,7 @@ static struct expr *ifname_expr_alloc(const struct location *location,
 				      struct list_head *queue,
 				      char *name)
 {
-	unsigned int length = strlen(name);
+	size_t length = strlen(name);
 	struct expr *expr;
 
 	if (length == 0) {
diff --git a/src/scanner.l b/src/scanner.l
index 31284d7358fa..aba8ef1c6b54 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -1117,7 +1117,7 @@ static int include_glob(struct nft_ctx *nft, void *scanner, const char *pattern,
 	ret = glob(pattern, flags, NULL, &glob_data);
 	if (ret == 0) {
 		char *path;
-		int len;
+		size_t len;
 
 		/* reverse alphabetical order due to stack */
 		for (i = glob_data.gl_pathc; i > 0; i--) {
-- 
2.41.0


  parent reply	other threads:[~2023-11-09 19:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 18:59 [PATCH nft 1/3] parser: don't mark "string" as const Thomas Haller
2023-11-09 18:59 ` [PATCH nft 2/3] parser: remove "const" from argument of input_descriptor_destroy() Thomas Haller
2023-11-15  9:42   ` Florian Westphal
2023-11-09 18:59 ` Thomas Haller [this message]
2023-11-15  9:41   ` [PATCH nft 3/3] parser: use size_t type for strlen() results Florian Westphal
2023-11-09 19:22 ` [PATCH nft 1/3] parser: don't mark "string" as const Pablo Neira Ayuso
2023-11-09 20:34   ` Thomas Haller
2023-11-09 23:10     ` Florian Westphal
2023-11-10  8:09       ` Thomas Haller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231109190032.669575-3-thaller@redhat.com \
    --to=thaller@redhat.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.