Bug 78462 - bad source code
bad source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: usbutils (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-23 07:24 EST by d.binderman
Modified: 2014-03-16 22:32 EDT (History)
1 user (show)

See Also:
Fixed In Version: 0.11-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-05-19 15:07:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2002-11-23 07:24:52 EST
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 15:07:52 EDT
Some bits added in 0.11-1.

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