From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LGxpU-0003i6-Aa for qemu-devel@nongnu.org; Sun, 28 Dec 2008 10:45:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LGxpS-0003hu-VA for qemu-devel@nongnu.org; Sun, 28 Dec 2008 10:45:23 -0500 Received: from [199.232.76.173] (port=39120 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LGxpS-0003hr-PG for qemu-devel@nongnu.org; Sun, 28 Dec 2008 10:45:22 -0500 Received: from savannah.gnu.org ([199.232.41.3]:49052 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LGxpS-0008Af-Eu for qemu-devel@nongnu.org; Sun, 28 Dec 2008 10:45:22 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LGxpS-0007VO-0z for qemu-devel@nongnu.org; Sun, 28 Dec 2008 15:45:22 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LGxpR-0007VJ-K6 for qemu-devel@nongnu.org; Sun, 28 Dec 2008 15:45:21 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Sun, 28 Dec 2008 15:45:21 +0000 Subject: [Qemu-devel] [6135] Suppress a -Werror=format-security warning Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6135 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6135 Author: blueswir1 Date: 2008-12-28 15:45:20 +0000 (Sun, 28 Dec 2008) Log Message: ----------- Suppress a -Werror=format-security warning Modified Paths: -------------- trunk/usb-linux.c Modified: trunk/usb-linux.c =================================================================== --- trunk/usb-linux.c 2008-12-28 13:14:48 UTC (rev 6134) +++ trunk/usb-linux.c 2008-12-28 15:45:20 UTC (rev 6135) @@ -1163,7 +1163,8 @@ int ret = 0; char filename[PATH_MAX]; - snprintf(filename, PATH_MAX, device_file, device_name); + snprintf(filename, PATH_MAX, USBSYSBUS_PATH "/devices/%s/%s", device_name, + device_file); f = fopen(filename, "r"); if (f) { fgets(line, line_size, f); @@ -1205,27 +1206,30 @@ tmpstr += 3; bus_num = atoi(tmpstr); - if (!usb_host_read_file(line, sizeof(line), USBSYSBUS_PATH "/devices/%s/devnum", de->d_name)) + if (!usb_host_read_file(line, sizeof(line), "devnum", de->d_name)) goto the_end; if (sscanf(line, "%d", &addr) != 1) goto the_end; - if (!usb_host_read_file(line, sizeof(line), USBSYSBUS_PATH "/devices/%s/bDeviceClass", de->d_name)) + if (!usb_host_read_file(line, sizeof(line), "bDeviceClass", + de->d_name)) goto the_end; if (sscanf(line, "%x", &class_id) != 1) goto the_end; - if (!usb_host_read_file(line, sizeof(line), USBSYSBUS_PATH "/devices/%s/idVendor", de->d_name)) + if (!usb_host_read_file(line, sizeof(line), "idVendor", de->d_name)) goto the_end; if (sscanf(line, "%x", &vendor_id) != 1) goto the_end; - if (!usb_host_read_file(line, sizeof(line), USBSYSBUS_PATH "/devices/%s/idProduct", de->d_name)) + if (!usb_host_read_file(line, sizeof(line), "idProduct", + de->d_name)) goto the_end; if (sscanf(line, "%x", &product_id) != 1) goto the_end; - if (!usb_host_read_file(line, sizeof(line), USBSYSBUS_PATH "/devices/%s/product", de->d_name)) { + if (!usb_host_read_file(line, sizeof(line), "product", + de->d_name)) { *product_name = 0; } else { if (strlen(line) > 0) @@ -1233,7 +1237,7 @@ pstrcpy(product_name, sizeof(product_name), line); } - if (!usb_host_read_file(line, sizeof(line), USBSYSBUS_PATH "/devices/%s/speed", de->d_name)) + if (!usb_host_read_file(line, sizeof(line), "speed", de->d_name)) goto the_end; if (!strcmp(line, "480\n")) speed = USB_SPEED_HIGH;