Skip to content

Commit fe073f5

Browse files
lib/list.c: Use size_t for array indices and sizes
Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org> Suggested-by: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
1 parent 37c85da commit fe073f5

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

lib/list.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
#include "config.h"
1010

11-
#ident "$Id$"
12-
13-
#include <assert.h>
11+
#include <stddef.h>
1412

1513
#include "alloc/malloc.h"
1614
#include "prototypes.h"
@@ -20,6 +18,8 @@
2018
#include "string/strdup/strdup.h"
2119
#include "string/strtok/strsep2ls.h"
2220

21+
#include <assert.h>
22+
2323

2424
/*
2525
* add_list - add a member to a list of group members
@@ -31,8 +31,8 @@
3131
/*@only@*/char **
3232
add_list(/*@returned@*/ /*@only@*/char **list, const char *member)
3333
{
34-
int i;
35-
char **tmp;
34+
size_t i;
35+
char **tmp;
3636

3737
assert (NULL != member);
3838
assert (NULL != list);
@@ -82,8 +82,8 @@ add_list(/*@returned@*/ /*@only@*/char **list, const char *member)
8282
/*@only@*/char **
8383
del_list(/*@returned@*/ /*@only@*/char **list, const char *member)
8484
{
85-
int i, j;
86-
char **tmp;
85+
size_t i, j;
86+
char **tmp;
8787

8888
assert (NULL != member);
8989
assert (NULL != list);
@@ -137,8 +137,8 @@ del_list(/*@returned@*/ /*@only@*/char **list, const char *member)
137137
/*@only@*/char **
138138
dup_list(char *const *list)
139139
{
140-
int i;
141-
char **tmp;
140+
size_t i;
141+
char **tmp;
142142

143143
assert (NULL != list);
144144

0 commit comments

Comments
 (0)