Skip to contentSkip to conversation

Fix -Wall warnings in udev 054 (chassis_id)

PATCH Applied Tobias Klauser 2 participants 2 messages Mar 10, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 Fix -Wall warnings in udev 054 (chassis_id)

Hi,

The following patch fixes a warning when compiling chassis_id from udev with the -Wall compiler flag. There are too much conversions in the format string of sscanf(). One %d can be dropped.

Thanks, Tobias

extras/chassis_id/table.c +1 -1
diff -urpN udev-054.orig/extras/chassis_id/table.c udev-054/extras/chassis_id/table.c
@@ -59,7 +59,7 @@ int table_init(void)
 	i = 0;
 	while (!feof(fp)) {
 		fgets(ptr, 80, fp);	
-		sscanf(ptr, "%d %d %d %d %d %s %s", &ptable[i].id,
+		sscanf(ptr, "%d %d %d %d %s %s", &ptable[i].id,
 			&ptable[i].num_disks, 
 			&ptable[i].chassis_num, &ptable[i].slot_num,
 			ptable[i].serial_num, ptable[i].name);

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

Applied
#1 lore raw
Quoted 15 lines · Tobias Klauser

Hi,

The following patch fixes a warning when compiling chassis_id from udev with the -Wall compiler flag. There are too much conversions in the format string of sscanf(). One %d can be dropped.

Thanks, Tobias

diff -urpN udev-054.orig/extras/chassis_id/table.c udev-054/extras/chassis_id/table.c

extras/chassis_id/table.c int table_init(void) · line 65

Quoted 8 lines
extras/chassis_id/table.c +1 -1
@@ -59,7 +59,7 @@ int table_init(void)
 	i = 0;
 	while (!feof(fp)) {
 		fgets(ptr, 80, fp);	
-		sscanf(ptr, "%d %d %d %d %d %s %s", &ptable[i].id,
+		sscanf(ptr, "%d %d %d %d %s %s", &ptable[i].id,
 			&ptable[i].num_disks, 
 			&ptable[i].chassis_num, &ptable[i].slot_num,
 			ptable[i].serial_num, ptable[i].name);

Applied.

Thanks,
Kay

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel