Skip to content
Commit 94bceb41 authored by Patrick Uiterwijk's avatar Patrick Uiterwijk Committed by Zbigniew Jędrzejewski-Szmek
Browse files

Fix format-truncation compile failure by typecasting USB IDs (#8250)



This patch adds safe_atoux16 for parsing an unsigned hexadecimal 16bit int, and
uses that for parsing USB device and vendor IDs.

This fixes a compile error with gcc-8 because while we know that USB IDs are 2 bytes,
the compiler does not know that.

../src/udev/udev-builtin-hwdb.c:80:38: error: '%04X' directive output may be
truncated writing between 4 and 8 bytes into a region of size between 2 and 6
[-Werror=format-truncation=]

Signed-off-by: default avatarAdam Williamson <awilliam@redhat.com>
Signed-off-by: default avatarPatrick Uiterwijk <puiterwijk@redhat.com>
(cherry picked from commit 5547c125)
parent 52dd3692
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment