list-local-devices.c:98:35: warning: ā%sā directive output may be truncated writing up to 255 bytes into a region of size 52 [-Wformat-truncation=] snprintf(fname, 63, "/dev/input/%s", namelist[i]->d_name);
Can't happen here, but rather than disable a potentially useful warning just up the path to the max size. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> --- tools/list-local-devices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c index 6aa7600..2afb1a3 100644 --- a/tools/list-local-devices.c +++ b/tools/list-local-devices.c @@ -93,9 +93,9 @@ int main(int argc, char **argv) } while (i--) { - char fname[64]; + char fname[PATH_MAX]; - snprintf(fname, 63, "/dev/input/%s", namelist[i]->d_name); + snprintf(fname, sizeof(fname), "/dev/input/%s", namelist[i]->d_name); dev = libwacom_new_from_path(db, fname, WFALLBACK_NONE, NULL); if (!dev) continue; -- 2.12.2 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel