Bug 78462 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: usbutils
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-23 12:24 UTC by d.binderman
Modified: 2014-03-17 02:32 UTC (History)
1 user (show)

Fixed In Version: 0.11-1
Clone Of:
Environment:
Last Closed: 2003-05-19 19:07:52 UTC
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2002-11-23 12:24:52 UTC
Description of Problem:

Hello there,

I just tried to compile package usbutils-0.9-7 from Redhat 8.0.

Here are some of the compiler messages.

lsusb.c:899: warning: `data' might be used uninitialized in this function
lsusb.c:899: warning: `hut' might be used uninitialized in this function
lsusb.c:1024: warning: `curinterface' might be used uninitialized in this function
lsusb.c:1380: warning: suggest parentheses around assignment used as truth value

Here is a bunch of patches which fix the messages.

*** ./lsusb.c.old	2002-11-05 14:03:14.000000000 +0000
--- ./lsusb.c	2002-11-05 14:04:11.000000000 +0000
***************
*** 896,902 ****
  
  static void dump_report_desc(unsigned char *b, int l)
  {
!         unsigned int t, j, bsize, btag, btype, data, hut;
  	int i;
  	char *types[4] = { "Main", "Global", "Local", "reserved" };
  	char indent[] = "                            ";
--- 896,902 ----
  
  static void dump_report_desc(unsigned char *b, int l)
  {
!         unsigned int t, j, bsize, btag, btype, data = 0, hut = 0;
  	int i;
  	char *types[4] = { "Main", "Global", "Local", "reserved" };
  	char indent[] = "                            ";
***************
*** 1021,1027 ****
  static void do_config(int fd, unsigned int nr, u_int16_t lang)
  {
  	unsigned char buf[1024],*p;
! 	unsigned int sz,curinterface;
  	int l;
  	u_int8_t curclass = 0xff, cursubclass = 0xff;
  
--- 1021,1027 ----
  static void do_config(int fd, unsigned int nr, u_int16_t lang)
  {
  	unsigned char buf[1024],*p;
! 	unsigned int sz,curinterface = 0;
  	int l;
  	u_int8_t curclass = 0xff, cursubclass = 0xff;
  
***************
*** 1377,1384 ****
  		exit(1);
  	}
  	if ((err = names_init("./usb.ids")) != 0)
! 		if(err = names_init(USBIDS_FILE)) {
! 			printf("Error, cannot open USBIDS File \"%s\", %s\n", USBIDS_FILE, strerror(err));
  			exit(1);
  	}
  	if (treemode)
--- 1377,1385 ----
  		exit(1);
  	}
  	if ((err = names_init("./usb.ids")) != 0)
! 		if ((err = names_init(USBIDS_FILE)) != 0) {
! 			printf("Error, cannot open USBIDS File \"%s\", %s\n", 
! 				USBIDS_FILE, strerror(err));
  			exit(1);
  	}
  	if (treemode)


Version-Release number of selected component (if applicable):


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:

Comment 1 Bill Nottingham 2003-05-19 19:07:52 UTC
Some bits added in 0.11-1.


Note You need to log in before you can comment on or make changes to this bug.