This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 106314 - bad source code
bad source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: xsane (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
David Lawrence
:
: 111532 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-05 05:48 EDT by d.binderman
Modified: 2007-04-18 12:58 EDT (History)
0 users

See Also:
Fixed In Version: 0.91-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-05 07:41:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2003-10-05 05:48:53 EDT
Description of problem:

Hello there,

I just tried to compile package xsane-0.89-3, from Redhat 9.0,
with compiler flag -Wall.

The compiler said

xsane-preview.c:5690: warning: operation on `image_data_rawp' may be undefined
xsane-preview.c:5690: warning: operation on `image_data_rawp' may be undefined
xsane-preview.c:5690: warning: operation on `image_data_rawp' may be undefined
xsane-preview.c:5690: warning: operation on `image_data_rawp' may be undefined

The source code is

	level = ((*image_data_rawp++) + (*image_data_rawp++) + (*image_data_rawp++)) / 3;

Better source code is

	level = ((*image_data_rawp) + (image_data_rawp[ 1]) + (image_data_rawp[ 2])) / 3;
	image_data_rawp += 3;



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


How reproducible:


Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:
Comment 1 Tim Waugh 2003-10-08 05:25:57 EDT
Fixed in CVS.  Thanks.
Comment 2 Tim Waugh 2003-12-05 07:41:04 EST
*** Bug 111532 has been marked as a duplicate of this bug. ***

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