Skip to content

Commit

Permalink
uffd: fix __u64 print format specifier
Browse files Browse the repository at this point in the history
coverity CID 389197:

CID 389197 (#1 of 1): Invalid printf format string (PRINTF_ARGS)
format_error: Length modifier L not applicable to conversion specifier in %Lu. [show details]
284 pr_err("Incompatible uffd API: expected %Lu, got %Lu\n", UFFD_API, uffdio_api.api);

Looking on C11 standard it seems that "%Lu" is undefined, we better not
use this, see:

"L Specifies that a following a, A, e, E, f, F, g, or G conversion
specifier applies to a long double argument."
http://port70.net/~nsz/c/c11/n1570.html#7.21.6.1p7

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
  • Loading branch information
Snorch authored and avagin committed Apr 29, 2022
1 parent 9e74735 commit 5a8fd34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion criu/uffd.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ int uffd_open(int flags, unsigned long *features, int *err)
}

if (uffdio_api.api != UFFD_API) {
pr_err("Incompatible uffd API: expected %Lu, got %Lu\n", UFFD_API, uffdio_api.api);
pr_err("Incompatible uffd API: expected %llu, got %llu\n", UFFD_API, uffdio_api.api);
goto close;
}

Expand Down

0 comments on commit 5a8fd34

Please sign in to comment.