Module Name: src
Committed By: abs
Date: Thu Apr 23 13:27:14 UTC 2015
Modified Files:
src/sbin/newfs_msdos: newfs_msdos.c
Log Message:
newfs_msdos allowed suffixes such as 'k', 'm' for some parameters,
but amusingly this did not include Block size, or Sectors per cluster.
Allow for all numeric parameters (If I want to specify the number
of drive heads as '1K', then why not?)
To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/newfs_msdos/newfs_msdos.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/newfs_msdos/newfs_msdos.c
diff -u src/sbin/newfs_msdos/newfs_msdos.c:1.42 src/sbin/newfs_msdos/newfs_msdos.c:1.43
--- src/sbin/newfs_msdos/newfs_msdos.c:1.42 Wed Jan 23 15:29:15 2013
+++ src/sbin/newfs_msdos/newfs_msdos.c Thu Apr 23 13:27:14 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs_msdos.c,v 1.42 2013/01/23 15:29:15 christos Exp $ */
+/* $NetBSD: newfs_msdos.c,v 1.43 2015/04/23 13:27:14 abs Exp $ */
/*
* Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
static const char rcsid[] =
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
#else
-__RCSID("$NetBSD: newfs_msdos.c,v 1.42 2013/01/23 15:29:15 christos Exp $");
+__RCSID("$NetBSD: newfs_msdos.c,v 1.43 2015/04/23 13:27:14 abs Exp $");
#endif
#endif /* not lint */
@@ -168,14 +168,13 @@ main(int argc, char *argv[])
static u_int
argtou(const char *arg, u_int lo, u_int hi, const char *msg)
{
- char *s;
- u_long x;
+ off_t x;
errno = 0;
- x = strtoul(arg, &s, 0);
- if (errno || !*arg || *s || x < lo || x > hi)
+ x = argtooff(arg, msg);
+ if (x < lo || x > hi)
errx(1, "%s: bad %s", arg, msg);
- return x;
+ return (u_int)x;
}
/*