cronnext.c: In function 'matchuser':
cronnext.c:193:21: warning: declaration of 'user' shadows a global declaration [-Wshadow]
int matchuser(char *user, char *list) {
^~~~
In file included from funcs.h:37:0,
from cronnext.c:32:
structs.h:71:3: note: shadowed declaration is here
} user;
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
/*
* match a user against a list
*/
-int matchuser(char *user, char *list) {
+int matchuser(char *user_name, char *list) {
char *pos;
- size_t l = strlen(user);
+ size_t l = strlen(user_name);
- for (pos = list; (pos = strstr(pos, user)) != NULL; pos += l) {
+ for (pos = list; (pos = strstr(pos, user_name)) != NULL; pos += l) {
if ((pos != list) && (*(pos - 1) != ','))
continue;
if ((pos[l] != '\0') && (pos[l] != ','))