From: Ben Kibbey Date: Sat, 6 Apr 2013 18:37:08 +0000 (-0400) Subject: Fix 'smatch' warnings. X-Git-Tag: v2.4~1 X-Git-Url: https://repo.or.cz/w/userinfo.git/commitdiff_plain/1300d435348453d00e6ba9d7bca9ef54cc97530a Fix 'smatch' warnings. --- diff --git a/src/modules/login.h b/src/modules/login.h index 62fd20b..10135df 100644 --- a/src/modules/login.h +++ b/src/modules/login.h @@ -75,7 +75,7 @@ typedef struct utmp UTMP; #ifdef HAVE_PROCFS #ifdef HAVE_DIRENT_H #include -DIR *procdir; +static DIR *procdir; #endif #endif diff --git a/src/modules/mail.c b/src/modules/mail.c index 8c8dc6c..8a9d530 100644 --- a/src/modules/mail.c +++ b/src/modules/mail.c @@ -153,7 +153,7 @@ static char *mail_aliases(const char *user, const int multi) if ((fd = open(ALIAS_FILE, O_RDONLY)) == -1) return "!"; - if ((aliasbuf = mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, + if ((aliasbuf = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) { warn("%s", "mmap()"); return "!"; diff --git a/src/ui.c b/src/ui.c index 2807fd8..87a0201 100644 --- a/src/ui.c +++ b/src/ui.c @@ -73,7 +73,7 @@ char *stamp(time_t epoch, const char *format) return buf; } -/* +/* * This may be used in modules to add a string to the buffer (ui_module_exec()). */ void add_string(char ***buf, const char *str) diff --git a/src/ui.h b/src/ui.h index 64a7a71..3f6a949 100644 --- a/src/ui.h +++ b/src/ui.h @@ -75,7 +75,7 @@ typedef int (module_options) (int argc, char **argv); typedef int (module_exec) (char ***, const struct passwd *, const int, const int, char *); -struct module_s { +static struct module_s { char name[PATH_MAX]; /* The filename of the module. */ void *m; /* The module handle. */ unsigned flags; /* dup, chained, chainable, and output. */