dist_man_MANS += \
login-utils/last.1 \
login-utils/lastb.1
-last_SOURCES = login-utils/last.c
+last_SOURCES = login-utils/last.c lib/strutils.c
install-exec-hook-last:
cd $(DESTDIR)$(usrsbin_execdir) && ln -sf last lastb
#include "xalloc.h"
#include "closestream.h"
#include "carefulputc.h"
+#include "strutils.h"
#ifndef SHUTDOWN_TIME
# define SHUTDOWN_TIME 254
#define R_TIMECHANGE 7 /* NEW_TIME or OLD_TIME */
/* Global variables */
-static int maxrecs = 0; /* Maximum number of records to list. */
-static int recsdone = 0; /* Number of records listed */
+static unsigned int maxrecs = 0; /* Maximum number of records to list. */
+static unsigned int recsdone = 0; /* Number of records listed */
static int showhost = 1; /* Show hostname too? */
static int altlist = 0; /* Show hostname at the end. */
static int usedns = 0; /* Use DNS to lookup the hostname. */
extended = 1;
break;
case 'n':
- maxrecs = atoi(optarg);
+ maxrecs = strtos32_or_err(optarg, _("failed to parse number"));
break;
case 'f':
altufile = xstrdup(optarg);