Deleted Added
full compact
40c40
< __FBSDID("$FreeBSD: head/bin/dd/args.c 273734 2014-10-27 11:38:17Z pi $");
---
> __FBSDID("$FreeBSD: head/bin/dd/args.c 273743 2014-10-27 17:39:37Z pi $");
44d43
< #include <ctype.h>
175c174,175
< errx(1, "seek offsets cannot be larger than %jd", OFF_MAX);
---
> errx(1, "seek offsets cannot be larger than %jd",
> (intmax_t)OFF_MAX);
188a189
> uintmax_t res;
190,192c191,194
< in.dbsz = out.dbsz = get_num(arg);
< if (out.dbsz < 1 || out.dbsz > SSIZE_MAX)
< errx(1, "bs must be between 1 and %jd", SSIZE_MAX);
---
> res = get_num(arg);
> if (res < 1 || res > SSIZE_MAX)
> errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_MAX);
> in.dbsz = out.dbsz = (size_t)res;
197a200
> uintmax_t res;
199,201c202,205
< cbsz = get_num(arg);
< if (cbsz < 1 || cbsz > SSIZE_MAX)
< errx(1, "cbs must be between 1 and %jd", SSIZE_MAX);
---
> res = get_num(arg);
> if (res < 1 || res > SSIZE_MAX)
> errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_MAX);
> cbsz = (size_t)res;
206a211
> intmax_t res;
208,212c213,219
< cpy_cnt = get_num(arg);
< if (cpy_cnt == SIZE_MAX)
< errc(1, ERANGE, "%s", oper);
< if (cpy_cnt == 0)
< cpy_cnt = -1;
---
> res = (intmax_t)get_num(arg);
> if (res < 0)
> errx(1, "count cannot be negative");
> if (res == 0)
> cpy_cnt = (uintmax_t)-1;
> else
> cpy_cnt = (uintmax_t)res;
221c228
< errx(1, "files must be between 1 and %ju", SIZE_MAX);
---
> errx(1, "files must be between 1 and %jd", (uintmax_t)-1);
236a244
> uintmax_t res;
239,241c247,251
< in.dbsz = get_num(arg);
< if (in.dbsz < 1 || in.dbsz > SSIZE_MAX)
< errx(1, "ibs must be between 1 and %ju", SSIZE_MAX);
---
> res = get_num(arg);
> if (res < 1 || res > SSIZE_MAX)
> errx(1, "ibs must be between 1 and %jd",
> (intmax_t)SSIZE_MAX);
> in.dbsz = (size_t)res;
254a265
> uintmax_t res;
257,259c268,272
< out.dbsz = get_num(arg);
< if (out.dbsz < 1 || out.dbsz > SSIZE_MAX)
< errx(1, "obs must be between 1 and %jd", SSIZE_MAX);
---
> res = get_num(arg);
> if (res < 1 || res > SSIZE_MAX)
> errx(1, "obs must be between 1 and %jd",
> (intmax_t)SSIZE_MAX);
> out.dbsz = (size_t)res;
368,373d380
< while (isspace(val[0]))
< val++;
<
< if (val[0] == '-')
< errx(1, "%s: cannot be negative", oper);
<
375c382
< num = strtoull(val, &expr, 0);
---
> num = strtouq(val, &expr, 0);
378c385
<
---
>