summaryrefslogtreecommitdiff
path: root/tools/list-local-devices.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-05-10 13:34:33 +1000
committerJason Gerecke <killertofu@gmail.com>2017-05-10 09:54:57 -0700
commit63631a09f3c28a583e79548561154d2a18193106 (patch)
treefb841faa7dcf267794f369a18f94a1c8a1cacabf /tools/list-local-devices.c
parent79d049ac537efda216e17cf1ca030265ec645784 (diff)
downloadlibwacom-63631a09f3c28a583e79548561154d2a18193106.tar.gz
Fix compiler warning about possibly truncated file name
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.hutterer@who-t.net> Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Diffstat (limited to 'tools/list-local-devices.c')
-rw-r--r--tools/list-local-devices.c4
1 files 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;