+2008-01-01 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/lastlog.c: Remove statbuf, not used.
+ * src/lastlog.c: Fix types, cast umin and umax to uid_t.
+ * src/lastlog.c: (option -u) user needs to be a signed long, not
+ uid_t (to accept rangees like -<uid>
+
2008-01-01 Nicolas François <nicolas.francois@centraliens.net>
* src/useradd.c: Avoid ?: construct without the middle term.
static int tflg = 0; /* print is restricted to most recent days */
static int bflg = 0; /* print excludes most recent days */
static struct lastlog lastlog; /* scratch structure to play with ... */
-static struct stat statbuf; /* fstat buffer for file size */
static struct passwd *pwent;
#define NOW (time ((time_t *) 0))
while ((pwent = getpwent ())) {
user = pwent->pw_uid;
if (uflg &&
- ((umin != -1 && user < umin) ||
- (umax != -1 && user > umax)))
+ ((umin != -1 && user < (uid_t)umin) ||
+ (umax != -1 && user > (uid_t)umax)))
continue;
offset = user * sizeof lastlog;
umax = umin;
} else {
char *endptr = NULL;
- uid_t user = strtol(optarg, &endptr, 10);
+ long int user;
+ user = strtol(optarg, &endptr, 10);
if (*optarg != '\0' && *endptr == '\0') {
if (user < 0) {
/* -<userid> */