Remove unsigned casts.
Discussed with: delphij, stefanf Approved by: grehan (mentor)
This commit is contained in:
parent
e9cee1ffe8
commit
d98720feaa
@ -94,6 +94,7 @@ main(int argc, char **argv)
|
|||||||
char *p;
|
char *p;
|
||||||
int ch;
|
int ch;
|
||||||
void *set;
|
void *set;
|
||||||
|
unsigned long ul;
|
||||||
|
|
||||||
/* Misc. initialization. */
|
/* Misc. initialization. */
|
||||||
(void)memset(&mi, '\0', sizeof(mi));
|
(void)memset(&mi, '\0', sizeof(mi));
|
||||||
@ -251,9 +252,10 @@ main(int argc, char **argv)
|
|||||||
autounit = true;
|
autounit = true;
|
||||||
unit = -1;
|
unit = -1;
|
||||||
} else {
|
} else {
|
||||||
unit = strtoul(unitstr, &p, 10);
|
ul = strtoul(unitstr, &p, 10);
|
||||||
if ((unsigned)unit == (unsigned)ULONG_MAX || *p != '\0')
|
if (ul == ULONG_MAX || *p != '\0')
|
||||||
errx(1, "bad device unit: %s", unitstr);
|
errx(1, "bad device unit: %s", unitstr);
|
||||||
|
unit = ul;
|
||||||
}
|
}
|
||||||
|
|
||||||
mtpoint = argv[1];
|
mtpoint = argv[1];
|
||||||
@ -363,6 +365,7 @@ do_mdconfig_attach_au(const char *args, const enum md_types mdtype)
|
|||||||
int rv;
|
int rv;
|
||||||
char *p;
|
char *p;
|
||||||
size_t linelen;
|
size_t linelen;
|
||||||
|
unsigned long ul;
|
||||||
|
|
||||||
switch (mdtype) {
|
switch (mdtype) {
|
||||||
case MD_SWAP:
|
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. */
|
/* Can't use strlcpy because linep is not NULL-terminated. */
|
||||||
strncpy(linebuf, linep + mdnamelen, linelen);
|
strncpy(linebuf, linep + mdnamelen, linelen);
|
||||||
linebuf[linelen] = '\0';
|
linebuf[linelen] = '\0';
|
||||||
unit = strtoul(linebuf, &p, 10);
|
ul = strtoul(linebuf, &p, 10);
|
||||||
if ((unsigned)unit == (unsigned)ULONG_MAX || *p != '\n')
|
if (ul == ULONG_MAX || *p != '\n')
|
||||||
errx(1, "unexpected output from mdconfig (attach)");
|
errx(1, "unexpected output from mdconfig (attach)");
|
||||||
|
unit = ul;
|
||||||
|
|
||||||
fclose(sfd);
|
fclose(sfd);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user