libc: small cleanups.

Unsign setlen: it is local and will never be negative. Having one more bit
for growth is beneficial and it avoids a cast when it's going to be used
for allocation.

Reviewed by:	ngie
MFC after:	3 days
This commit is contained in:
pfg 2017-03-12 03:26:25 +00:00
parent d2ff5eb11a
commit 026df5dbae

View File

@ -175,7 +175,7 @@ setmode(const char *p)
mode_t mask, perm, permXbits, who;
long perml;
int equalopdone;
int setlen;
u_int setlen;
if (!*p) {
errno = EINVAL;
@ -190,7 +190,7 @@ setmode(const char *p)
setlen = SET_LEN + 2;
if ((set = malloc((u_int)(sizeof(BITCMD) * setlen))) == NULL)
if ((set = malloc(setlen * sizeof(BITCMD))) == NULL)
return (NULL);
saveset = set;
endset = set + (setlen - 2);