diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2005-01-03 19:03:40 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2005-01-03 19:03:40 +0000 |
| commit | d266903483c2b9061eda8df19cba2e5cf94e0c11 (patch) | |
| tree | 2ad7b721f31dd1495295d880e2d10ee082a23566 /sbin/badsect | |
| parent | 7bb84191e67aba9f11f9b4883ba52478cd0be4e7 (diff) | |
Notes
Diffstat (limited to 'sbin/badsect')
| -rw-r--r-- | sbin/badsect/badsect.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/badsect/badsect.c b/sbin/badsect/badsect.c index 96c319de3023..93891714c193 100644 --- a/sbin/badsect/badsect.c +++ b/sbin/badsect/badsect.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include <ufs/ffs/fs.h> #include <err.h> +#include <errno.h> #include <dirent.h> #include <fcntl.h> #include <libufs.h> @@ -123,7 +124,9 @@ main(int argc, char *argv[]) err(7, "%s", name); } for (argc -= 2, argv += 2; argc > 0; argc--, argv++) { - number = atol(*argv); + number = strtol(*argv, NULL, 0); + if (errno == EINVAL || errno == ERANGE) + err(8, "%s", *argv); if (chkuse(number, 1)) continue; /* |
