2
0
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:
Todd C. Miller
2010-07-27 07:50:43 -04:00
parent 14909efc66
commit a3e4db1244

View File

@@ -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);