}
break;
case 'O':
- offset = strtosize_or_err(optarg, "failed to parse offset");
+ offset = strtosize_or_err(optarg, "invalid offset argument");
break;
case 'p':
lowprobe |= LOWPROBE_SUPERBLOCKS;
show[numtag] = NULL;
break;
case 'S':
- size = strtosize_or_err(optarg, "failed to parse size");
+ size = strtosize_or_err(optarg, "invalid size argument");
break;
case 't':
if (search_type) {
day = month = year = 0;
switch(argc) {
case 3:
- day = strtol_or_err(*argv++, _("illegal day value"));
+ day = strtos32_or_err(*argv++, _("illegal day value"));
if (day < 1 || 31 < day)
errx(EXIT_FAILURE, _("illegal day value: use 1-%d"), 31);
/* FALLTHROUGH */
case 2:
- month = strtol_or_err(*argv++, _("illegal month value: use 1-12"));
+ month = strtos32_or_err(*argv++, _("illegal month value: use 1-12"));
if (month < 1 || 12 < month)
errx(EXIT_FAILURE, _("illegal month value: use 1-12"));
/* FALLTHROUGH */
case 1:
- year = strtol_or_err(*argv++, _("illegal year value: use 1-9999"));
+ year = strtos32_or_err(*argv++, _("illegal year value: use 1-9999"));
if (year < 1 || 9999 < year)
errx(EXIT_FAILURE, _("illegal year value: use 1-9999"));
if (day) {
flags |= FL_NOSWAPMATCH;
break;
case 'w':
- timeout = strtol_or_err(optarg,
- _("failed to parse timeout"));
+ timeout = strtos32_or_err(optarg, _("invalid timeout argument"));
break;
case 'V':
printf(UTIL_LINUX_VERSION);
argc--, argv++;
arg = *argv;
#ifdef HAVE_SIGQUEUE
- sigdata.sival_int = strtol_or_err(arg, _("failed to parse sigval"));
+ sigdata.sival_int = strtos32_or_err(arg, _("invalid sigval argument"));
use_sigval = 1;
#endif
continue;
int pencode __P((char *));
static int optd = 0;
-static int udpport = 514;
+static uint16_t udpport = 514;
static int
myopenlog(const char *sock) {
}
static int
-udpopenlog(const char *servername,int port) {
+udpopenlog(const char *servername, uint16_t port) {
int fd;
struct sockaddr_in s_addr;
struct hostent *serverhost;
char *usock = NULL;
char *udpserver = NULL;
int LogSock = -1;
- long tmpport;
static const struct option longopts[] = {
{ "id", no_argument, 0, 'i' },
udpserver = optarg;
break;
case 'P': /* change udp port */
- tmpport = strtol_or_err(optarg,
- _("failed to parse port number"));
- if (tmpport < 0 || 65535 < tmpport)
- errx(EXIT_FAILURE, _("port `%ld' out of range"),
- tmpport);
- udpport = (int) tmpport;
+ udpport = strtou16_or_err(optarg,
+ _("invalid port number argument"));
break;
case 'V':
printf(_("%s from %s\n"), program_invocation_short_name,
* If user passed a pid we filter it later when adding
* to the list, no need to worry now.
*/
- l->pid = strtol_or_err(tok, _("failed to parse pid"));
+ l->pid = strtos32_or_err(tok, _("failed to parse pid"));
l->cmdname = get_cmdname(l->pid);
if (!l->cmdname)
l->cmdname = xstrdup(_("(unknown)"));
case 6: /* start */
l->start = !strcmp(tok, "EOF") ? 0 :
- strtol_or_err(tok, _("failed to parse start"));
+ strtou64_or_err(tok, _("failed to parse start"));
break;
case 7: /* end */
/* replace '\n' character */
tok[strlen(tok)-1] = '\0';
l->end = !strcmp(tok, "EOF") ? 0 :
- strtol_or_err(tok, _("failed to parse end"));
+ strtou64_or_err(tok, _("failed to parse end"));
break;
default:
break;
switch(c) {
case 'p':
- pid = strtol_or_err(optarg, _("cannot parse PID"));
+ pid = strtos32_or_err(optarg, _("invalid PID argument"));
break;
case 'o':
ncolumns = string_to_idarray(optarg,
break;
case 'o':
wp0 = add_offset(wp0, strtosize_or_err(optarg,
- _("failed to parse offset")), 1);
+ _("invalid offset argument")), 1);
has_offset++;
break;
case 'p':