Revert r343634:

Mostly a cosmetic change to replace strlen with strnlen.

Requested by:	kib and imp
This commit is contained in:
araujo 2019-02-01 03:09:11 +00:00
parent ba89e642b3
commit 1eb1213077
3 changed files with 5 additions and 6 deletions

View File

@ -233,8 +233,8 @@ usage(int code)
" -W: force virtio to use single-vector MSI\n"
" -x: local apic is in x2APIC mode\n"
" -Y: disable MPtable generation\n",
progname, (int)strnlen(progname, PATH_MAX), "", (int)strnlen(progname, PATH_MAX), "",
(int)strnlen(progname, PATH_MAX), "");
progname, (int)strlen(progname), "", (int)strlen(progname), "",
(int)strlen(progname), "");
exit(code);
}

View File

@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure *template_entry,
int len;
string = template_strings[i];
len = strnlen(string, SMBIOS_MAX_LENGTH) + 1;
len = strlen(string) + 1;
memcpy(curaddr, string, len);
curaddr += len;
}
@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure *template_entry,
return (-1);
MD5Init(&mdctx);
MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX));
MD5Update(&mdctx, vmname, strlen(vmname));
MD5Update(&mdctx, hostname, sizeof(hostname));
MD5Final(digest, &mdctx);

View File

@ -70,7 +70,6 @@ enum {
UMSTR_MAX
};
#define UMOUSE_DESC_MAX_LEN 32
static const char *umouse_desc_strings[] = {
"\x04\x09",
"BHYVE",
@ -442,7 +441,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
goto done;
}
slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2;
slen = 2 + strlen(str) * 2;
udata[0] = slen;
udata[1] = UDESC_STRING;