Skip to content

Commit f460ab4

Browse files
committed
efivar, efisecdb: use PRIu64 for well-known-guids count
The debug() prints of efi_n_well_known_guids, which is uint64_t, used %lu. On 32-bit unsigned long is 32-bit, so this mismatches the argument. Use the PRIu64 macro from inttypes.h, consistent with other 64-bit prints elsewhere in the codebase (dp-hw.c, dp-media.c, etc.).
1 parent 31cd025 commit f460ab4

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/efisecdb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <errno.h>
1111
#include <fcntl.h>
1212
#include <getopt.h>
13+
#include <inttypes.h>
1314
#include <stdarg.h>
1415
#include <stdint.h>
1516
#include <stdlib.h>
@@ -244,7 +245,7 @@ list_guids(void)
244245
const uint64_t n = efi_n_well_known_guids;
245246
unsigned int i;
246247

247-
debug("&guid[0]:%p n:%lu", &guid[0], n);
248+
debug("&guid[0]:%p n:%"PRIu64, &guid[0], n);
248249
for (i = 0; i < n; i++) {
249250
printf("{"GUID_FORMAT"}\t",
250251
GUID_FORMAT_ARGS(&guid[i].guid));

src/efivar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <err.h>
1111
#include <fcntl.h>
1212
#include <getopt.h>
13+
#include <inttypes.h>
1314
#include <stdio.h>
1415
#include <stdlib.h>
1516
#include <sys/mman.h>
@@ -573,7 +574,7 @@ int main(int argc, char *argv[])
573574
const uint64_t n = efi_n_well_known_guids;
574575
size_t i;
575576

576-
debug("&guid[0]:%p n:%lu end:%p", &guid[0], n, &guid[n]);
577+
debug("&guid[0]:%p n:%"PRIu64" end:%p", &guid[0], n, &guid[n]);
577578
for (i = 0; i < n; i++) {
578579
printf("{"GUID_FORMAT"}\t",
579580
GUID_FORMAT_ARGS(&guid[i].guid));

0 commit comments

Comments
 (0)