loader: Fix compiler warnings about truncating the PCI ID path.
authorEric Anholt <eric@anholt.net>
Sat, 10 Feb 2018 10:45:18 +0000 (10:45 +0000)
committerEric Anholt <eric@anholt.net>
Wed, 21 Feb 2018 04:23:57 +0000 (20:23 -0800)
commit7075c084fc5699d76970d2f045c8c7c668dc53d8
treef39e8accbefaefea288ac1a7116c6c852e121bba
parent1b313eedb5e5da3c7ee3f62a83b66a6e097fe0d3
loader: Fix compiler warnings about truncating the PCI ID path.

My build was producing:

../src/loader/loader.c:121:67: warning: ā€˜%1uā€™ directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Wformat-truncation=]

and we can avoid this careful calculation by just using asprintf (as we do
elsewhere in the file).

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/loader/loader.c