From 86fbb15cb7ff82e02674713013141a3bd1ead12d Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 20 Apr 2020 14:07:05 +0200 Subject: [PATCH] device: Fix compilation with GCC 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Class is using only 3 bytes so make sure GCC is aware of that. src/device.c:397:3: note: ‘sprintf’ output between 9 and 11 bytes into a destination of size 9 397 | sprintf(class, "0x%6.6x", device->class); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors --- src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 5f9ad227d..a8d95346a 100644 --- a/src/device.c +++ b/src/device.c @@ -394,7 +394,7 @@ static gboolean store_device_info_cb(gpointer user_data) g_key_file_remove_key(key_file, "General", "Alias", NULL); if (device->class) { - sprintf(class, "0x%6.6x", device->class); + sprintf(class, "0x%6.6x", device->class & 0xffffff); g_key_file_set_string(key_file, "General", "Class", class); } else { g_key_file_remove_key(key_file, "General", "Class", NULL); -- 2.47.3