summaryrefslogtreecommitdiffstats
path: root/sbin/mdmfs
diff options
context:
space:
mode:
authorssouhlal <ssouhlal@FreeBSD.org>2005-01-31 04:45:45 +0000
committerssouhlal <ssouhlal@FreeBSD.org>2005-01-31 04:45:45 +0000
commitd98720feaa310a562680ce2b05d89804ece10a2f (patch)
treedfc6fecb7dc296813d7fdc0892085da1da4294f0 /sbin/mdmfs
parente9cee1ffe865dac9398097ebf0f27fdebac55bfd (diff)
downloadFreeBSD-src-d98720feaa310a562680ce2b05d89804ece10a2f.zip
FreeBSD-src-d98720feaa310a562680ce2b05d89804ece10a2f.tar.gz
Remove unsigned casts.
Discussed with: delphij, stefanf Approved by: grehan (mentor)
Diffstat (limited to 'sbin/mdmfs')
-rw-r--r--sbin/mdmfs/mdmfs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c
index d276dc0..e2a14a0 100644
--- a/sbin/mdmfs/mdmfs.c
+++ b/sbin/mdmfs/mdmfs.c
@@ -94,6 +94,7 @@ main(int argc, char **argv)
char *p;
int ch;
void *set;
+ unsigned long ul;
/* Misc. initialization. */
(void)memset(&mi, '\0', sizeof(mi));
@@ -251,9 +252,10 @@ main(int argc, char **argv)
autounit = true;
unit = -1;
} else {
- unit = strtoul(unitstr, &p, 10);
- if ((unsigned)unit == (unsigned)ULONG_MAX || *p != '\0')
+ ul = strtoul(unitstr, &p, 10);
+ if (ul == ULONG_MAX || *p != '\0')
errx(1, "bad device unit: %s", unitstr);
+ unit = ul;
}
mtpoint = argv[1];
@@ -363,6 +365,7 @@ do_mdconfig_attach_au(const char *args, const enum md_types mdtype)
int rv;
char *p;
size_t linelen;
+ unsigned long ul;
switch (mdtype) {
case MD_SWAP:
@@ -399,9 +402,10 @@ do_mdconfig_attach_au(const char *args, const enum md_types mdtype)
/* Can't use strlcpy because linep is not NULL-terminated. */
strncpy(linebuf, linep + mdnamelen, linelen);
linebuf[linelen] = '\0';
- unit = strtoul(linebuf, &p, 10);
- if ((unsigned)unit == (unsigned)ULONG_MAX || *p != '\n')
+ ul = strtoul(linebuf, &p, 10);
+ if (ul == ULONG_MAX || *p != '\n')
errx(1, "unexpected output from mdconfig (attach)");
+ unit = ul;
fclose(sfd);
close(fd);
OpenPOWER on IntegriCloud