mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Use errorx() not error() for thingsthat don't set errno.
This commit is contained in:
@@ -249,13 +249,13 @@ main(int argc, char *argv[])
|
||||
errno = 0;
|
||||
max_wait = strtod(optarg, &ep);
|
||||
if (*ep != '\0' || errno != 0)
|
||||
error(1, "invalid max wait: %s", optarg);
|
||||
errorx(1, "invalid max wait: %s", optarg);
|
||||
break;
|
||||
case 's':
|
||||
errno = 0;
|
||||
speed = strtod(optarg, &ep);
|
||||
if (*ep != '\0' || errno != 0)
|
||||
error(1, "invalid speed factor: %s", optarg);
|
||||
errorx(1, "invalid speed factor: %s", optarg);
|
||||
break;
|
||||
case 'V':
|
||||
(void) printf("%s version %s\n", getprogname(), PACKAGE_VERSION);
|
||||
@@ -347,21 +347,21 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
idx = strtoul(buf, &ep, 10);
|
||||
if (idx > IOFD_MAX)
|
||||
error(1, "invalid timing file index: %s", cp);
|
||||
errorx(1, "invalid timing file index: %s", cp);
|
||||
for (cp = ep + 1; isspace((unsigned char) *cp); cp++)
|
||||
continue;
|
||||
|
||||
errno = 0;
|
||||
seconds = strtod(cp, &ep);
|
||||
if (errno != 0 || !isspace((unsigned char) *ep))
|
||||
error(1, "invalid timing file line: %s", buf);
|
||||
errorx(1, "invalid timing file line: %s", buf);
|
||||
for (cp = ep + 1; isspace((unsigned char) *cp); cp++)
|
||||
continue;
|
||||
|
||||
errno = 0;
|
||||
nbytes = strtoul(cp, &ep, 10);
|
||||
if (errno == ERANGE && nbytes == ULONG_MAX)
|
||||
error(1, "invalid timing file byte count: %s", cp);
|
||||
errorx(1, "invalid timing file byte count: %s", cp);
|
||||
|
||||
if (interactive)
|
||||
check_input(STDIN_FILENO, &speed);
|
||||
|
Reference in New Issue
Block a user