www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Rubin <pru...@transactor.net>
Subject mod_jserv/4572: parenthesis error in source code
Date Sat, 12 Jun 1999 02:41:25 GMT

>Number:         4572
>Category:       mod_jserv
>Synopsis:       parenthesis error in source code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Jun 11 19:50:01 PDT 1999
>Last-Modified:
>Originator:     prubin@transactor.net
>Organization:
apache
>Release:        jserv source 1.0b5
>Environment:
Solaris 2.6, jdk 1.1.6
>Description:
jserv_mmap.c lines 104 and 112 need additional parentheses:

104:    if (nb = write (fd, &h, sizeof(h)) !=  sizeof(h)) {
	    /* error */
            jserv_error(JSERV_LOG_EMERG,cfg,"jserv_mmap:error writing ");
        }
	for (i=0;i<NB_MAX_JSERVS;i++) {
	    js[i].state = DOWN;
	    js[i].name[0] = '\0';
	}
112:    if (nb = write (fd, js, sizeof(js)) !=  sizeof(js)) {
            ....

Notice that the != takes precedence over the = in these
would-be assignments.  Correct is to say
if ((nb = write (fd, js, sizeof (js))) != sizeof(js)) { ...

>How-To-Repeat:

>Fix:

>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <apbugs@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]




Mime
View raw message