Page MenuHomeFreeBSD

D40425.id122859.diff
No OneTemporary

D40425.id122859.diff

diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -124,7 +124,6 @@
int ch, Jflag, nargs, nflag, nline;
size_t linelen;
struct rlimit rl;
- char *endptr;
const char *errstr;
inpline = replstr = NULL;
@@ -175,23 +174,23 @@
replstr = optarg;
break;
case 'L':
- Lflag = strtonum(optarg, 0, INT_MAX, &errstr);
+ Lflag = (int)strtonum(optarg, 0, INT_MAX, &errstr);
if (errstr)
- errx(1, "-L %s: %s", optarg, errstr);
+ errx(1, "-%c %s: %s", ch, optarg, errstr);
break;
case 'n':
nflag = 1;
- nargs = strtonum(optarg, 1, INT_MAX, &errstr);
+ nargs = (int)strtonum(optarg, 1, INT_MAX, &errstr);
if (errstr)
- errx(1, "-n %s: %s", optarg, errstr);
+ errx(1, "-%c %s: %s", ch, optarg, errstr);
break;
case 'o':
oflag = 1;
break;
case 'P':
- maxprocs = strtonum(optarg, 0, INT_MAX, &errstr);
+ maxprocs = (int)strtonum(optarg, 0, INT_MAX, &errstr);
if (errstr)
- errx(1, "-P %s: %s", optarg, errstr);
+ errx(1, "-%c %s: %s", ch, optarg, errstr);
if (getrlimit(RLIMIT_NPROC, &rl) != 0)
errx(1, "getrlimit failed");
if (maxprocs == 0 || maxprocs > rl.rlim_cur)
@@ -201,22 +200,22 @@
pflag = 1;
break;
case 'R':
- Rflag = strtol(optarg, &endptr, 10);
- if (*endptr != '\0')
- errx(1, "replacements must be a number");
+ Rflag = (int)strtonum(optarg, 0, INT_MAX, &errstr);
+ if (errstr)
+ errx(1, "-%c %s: %s", ch, optarg, errstr);
break;
case 'r':
/* GNU compatibility */
break;
case 'S':
- Sflag = strtoul(optarg, &endptr, 10);
- if (*endptr != '\0')
- errx(1, "replsize must be a number");
+ Sflag = (int)strtonum(optarg, 0, INT_MAX, &errstr);
+ if (errstr)
+ errx(1, "-%c %s: %s", ch, optarg, errstr);
break;
case 's':
- nline = strtonum(optarg, 0, INT_MAX, &errstr);
+ nline = (int)strtonum(optarg, 0, INT_MAX, &errstr);
if (errstr)
- errx(1, "-s %s: %s", optarg, errstr);
+ errx(1, "-%c %s: %s", ch, optarg, errstr);
break;
case 't':
tflag = 1;

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 11:41 AM (22 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14737414
Default Alt Text
D40425.id122859.diff (2 KB)

Event Timeline