Deleted Added
full compact
args.c (112254) args.c (112265)
1/*-
2 * Copyright (c) 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Keith Muller of the University of California, San Diego and Lance
7 * Visser of Convex Computer Corporation.
8 *

--- 27 unchanged lines hidden (view full) ---

36 */
37
38#ifndef lint
39#if 0
40static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94";
41#endif
42#endif /* not lint */
43#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Keith Muller of the University of California, San Diego and Lance
7 * Visser of Convex Computer Corporation.
8 *

--- 27 unchanged lines hidden (view full) ---

36 */
37
38#ifndef lint
39#if 0
40static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94";
41#endif
42#endif /* not lint */
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/bin/dd/args.c 112254 2003-03-15 07:56:59Z ru $");
44__FBSDID("$FreeBSD: head/bin/dd/args.c 112265 2003-03-15 13:34:48Z ru $");
45
46#include <sys/types.h>
47
48#include <err.h>
49#include <errno.h>
50#include <inttypes.h>
51#include <limits.h>
52#include <stdlib.h>

--- 131 unchanged lines hidden (view full) ---

184
185static void
186f_bs(char *arg)
187{
188 uintmax_t res;
189
190 res = get_num(arg);
191 if (res < 1 || res > SSIZE_MAX)
45
46#include <sys/types.h>
47
48#include <err.h>
49#include <errno.h>
50#include <inttypes.h>
51#include <limits.h>
52#include <stdlib.h>

--- 131 unchanged lines hidden (view full) ---

184
185static void
186f_bs(char *arg)
187{
188 uintmax_t res;
189
190 res = get_num(arg);
191 if (res < 1 || res > SSIZE_MAX)
192 errx(1, "bs must be between 1 and %zd", SSIZE_MAX);
192 errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_MAX);
193 in.dbsz = out.dbsz = (size_t)res;
194}
195
196static void
197f_cbs(char *arg)
198{
199 uintmax_t res;
200
201 res = get_num(arg);
202 if (res < 1 || res > SSIZE_MAX)
193 in.dbsz = out.dbsz = (size_t)res;
194}
195
196static void
197f_cbs(char *arg)
198{
199 uintmax_t res;
200
201 res = get_num(arg);
202 if (res < 1 || res > SSIZE_MAX)
203 errx(1, "cbs must be between 1 and %zd", SSIZE_MAX);
203 errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_MAX);
204 cbsz = (size_t)res;
205}
206
207static void
208f_count(char *arg)
209{
210 intmax_t res;
211

--- 18 unchanged lines hidden (view full) ---

230static void
231f_ibs(char *arg)
232{
233 uintmax_t res;
234
235 if (!(ddflags & C_BS)) {
236 res = get_num(arg);
237 if (res < 1 || res > SSIZE_MAX)
204 cbsz = (size_t)res;
205}
206
207static void
208f_count(char *arg)
209{
210 intmax_t res;
211

--- 18 unchanged lines hidden (view full) ---

230static void
231f_ibs(char *arg)
232{
233 uintmax_t res;
234
235 if (!(ddflags & C_BS)) {
236 res = get_num(arg);
237 if (res < 1 || res > SSIZE_MAX)
238 errx(1, "ibs must be between 1 and %zd", SSIZE_MAX);
238 errx(1, "ibs must be between 1 and %jd",
239 (intmax_t)SSIZE_MAX);
239 in.dbsz = (size_t)res;
240 }
241}
242
243static void
244f_if(char *arg)
245{
246
247 in.name = arg;
248}
249
250static void
251f_obs(char *arg)
252{
253 uintmax_t res;
254
255 if (!(ddflags & C_BS)) {
256 res = get_num(arg);
257 if (res < 1 || res > SSIZE_MAX)
240 in.dbsz = (size_t)res;
241 }
242}
243
244static void
245f_if(char *arg)
246{
247
248 in.name = arg;
249}
250
251static void
252f_obs(char *arg)
253{
254 uintmax_t res;
255
256 if (!(ddflags & C_BS)) {
257 res = get_num(arg);
258 if (res < 1 || res > SSIZE_MAX)
258 errx(1, "obs must be between 1 and %zd", SSIZE_MAX);
259 errx(1, "obs must be between 1 and %jd",
260 (intmax_t)SSIZE_MAX);
259 out.dbsz = (size_t)res;
260 }
261}
262
263static void
264f_of(char *arg)
265{
266

--- 206 unchanged lines hidden ---
261 out.dbsz = (size_t)res;
262 }
263}
264
265static void
266f_of(char *arg)
267{
268

--- 206 unchanged lines hidden ---