Bug 110823 - bad source code
bad source code
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: mtools (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-24 12:09 EST by d.binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-09 07:08:59 EST
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 2003-11-24 12:09:11 EST
Description of problem:

I just tried to compile package mtools-3_9_9-3 from Fedora.

The compiler said

1.

config.c(567): warning #187: use of "=" where "==" may have been 
intended
config.c(568): warning #187: use of "=" where "==" may have been 
intended
config.c(569): warning #187: use of "=" where "==" may have been 
intended
config.c(570): warning #187: use of "=" where "==" may have been 
intended

The source code is

    if((match_token("drive") && ((action = 1)))||
       (match_token("drive+") && ((action = 2))) ||
       (match_token("+drive") && ((action = 3))) ||
       (match_token("clear_drive") && ((action = 4))) ) {

You might be better off with 

    if((match_token("drive") && ((action == 1)))||
       (match_token("drive+") && ((action == 2))) ||
       (match_token("+drive") && ((action == 3))) ||
       (match_token("clear_drive") && ((action == 4))) ) {

But location variable "action" has the value 0 anyway.

2.

mformat.c(1102): warning #175: subscript out of range

The source code is

                set_word(boot->jump + 510, 0xaa55);

But
        unsigned char jump[3];          /* 0  Jump to boot code */

Not sure what might be better code here.


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

How reproducible:


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


Expected results:


Additional info:
Comment 1 Tim Waugh 2003-12-09 07:08:59 EST
I think this code is as intended.  See the extra set of parentheses on
each test, and the larger picture of what the code is trying to do.

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