From 45446c1c1d4a603702a75a4e3372def983674c0d Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sat, 18 May 2024 16:41:30 +0800 Subject: [PATCH] Bootmgr (FreeBSD): silence compiler warnings --- src/detection/bootmgr/bootmgr_bsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detection/bootmgr/bootmgr_bsd.c b/src/detection/bootmgr/bootmgr_bsd.c index 77d4e6a43..86fe86fac 100644 --- a/src/detection/bootmgr/bootmgr_bsd.c +++ b/src/detection/bootmgr/bootmgr_bsd.c @@ -23,8 +23,8 @@ const char* ffDetectBootmgr(FFBootmgrResult* result) if (ioctl(efifd, EFIIOC_VAR_GET, &ioc) < 0 || ioc.datasize != 2) return "ioctl(EFIIOC_VAR_GET, BootCurrent) failed"; - char hex[5]; - snprintf(hex, sizeof(hex), "%04X", *(uint16_t*)buffer); + unsigned char hex[5]; + snprintf((char*) hex, sizeof(hex), "%04X", *(uint16_t*)buffer); ioc.datasize = sizeof(buffer); ioc.name = (efi_char[]){ 'B', 'o', 'o', 't', hex[0], hex[1], hex[2], hex[3], '\0' }; ioc.namesize = sizeof("Boot####") * 2;