Bug 110800 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: imap
Version: 1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: John Dennis
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-24 16:20 UTC by d.binderman
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-01-27 15:20:28 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2003-11-24 16:20:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)

Description of problem:


I just tried to compile package imap-2002d-3 from Fedora.

The compiler said

env_unix.c(1180): warning #187: use of "=" where "==" may have been 
intended

The source code is

          (read (fd,tmp,i) == i) && !(tmp[i] = 0) && ((i = atol 
(tmp)) > 0))

Might be better off with

          (read (fd,tmp,i) == i) 
			&& !(tmp[i] == 0) && ((i = atol (tmp)) > 0))



Version-Release number of selected component (if applicable):
imap-2002d-3 

How reproducible:
Always

Steps to Reproduce:
1. by inspection
2.
3.
    

Additional info:

Comment 1 Kenneth Porter 2004-01-24 02:25:29 UTC
The code is ugly, but the assignment looks correct.

Untested, but to eliminate the warning, replace the expression
"!(tmp[i]=0)" with "(0 == (tmp[i] = 0))". (This is just
null-terminating the buffer before running atol.) Still ugly, but it
should eliminate the warning.

Comment 2 John Dennis 2004-01-27 15:20:28 UTC
This is not a Red Hat issue but rather an upstream issue for the UW
imap authors. If you would like to address this in the UW Imap forum
you may do so, discussion occurs on the c-client list and you can find
sign up information here: http://www.washington.edu/imap


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