]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libsmb: Remove unused variable 'i'
authorAndreas Schneider <asn@samba.org>
Fri, 3 Feb 2023 13:25:33 +0000 (14:25 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 6 Feb 2023 22:51:31 +0000 (22:51 +0000)
namecache.c:129:9: error: variable 'i' set but not used
  [-Werror,-Wunused-but-set-variable]
        size_t i, count;
               ^

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/namecache.c

index 66147bab7f247eb889fdcdab01857e3806088721..d172f59f8487b90220415dbf07df5da4b2ff3fde 100644 (file)
@@ -126,7 +126,7 @@ static int ipstr_list_parse(TALLOC_CTX *ctx,
        TALLOC_CTX *frame = talloc_stackframe();
        struct samba_sockaddr *sa_list = NULL;
        char *token_str = NULL;
-       size_t i, count;
+       size_t count;
        size_t array_size;
 
        *sa_list_out = NULL;
@@ -141,8 +141,10 @@ static int ipstr_list_parse(TALLOC_CTX *ctx,
        }
 
        count = 0;
-       for (i=0; next_token_talloc(frame, &ipstr_list, &token_str,
-                               IPSTR_LIST_SEP); i++ ) {
+       while (next_token_talloc(frame,
+                                &ipstr_list,
+                                &token_str,
+                                IPSTR_LIST_SEP)) {
                bool ok;
                char *s = token_str;
                char *p = strrchr(token_str, ':');