Subject: bin/6029: egcs-revealed brace fixes for /usr/src/libexec
To: None <gnats-bugs@gnats.netbsd.org>
From: Erik Bertelsen <erik@q610.ebe.uni-c.dk>
List: netbsd-bugs
Date: 08/24/1998 23:11:48
>Number:         6029
>Category:       bin
>Synopsis:       egcs-revealed brace fixes for /usr/src/libexec
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 24 14:20:00 1998
>Last-Modified:
>Originator:     Erik Bertelsen
>Organization:
	
>Release:        NetBSD-current  23 Aug 1998
>Environment:
	
System: NetBSD q610.ebe.uni-c.dk 1.3G NetBSD 1.3G (Q610) #184: Sun Aug 23 23:59:05 MEST 1998 erik@q610.ebe.uni-c.dk:/home/src/sys/arch/mac68k/compile/Q610 mac68k


>Description:
	When compiling /usr/src/libexec with egcs 1.1, several warnings
	are issued related to braces and possibly ambigous if constructions.
	These seem to be fixed as detected in -current.
	Here is my batch of fixes for /usr/src/libexec, which concerns
	two files: rlogind.c and rmail.c.

	regards
Erik Bertelsen
>How-To-Repeat:
>Fix:
Index: rlogind/rlogind.c
===================================================================
RCS file: /home/cvs-base/src/libexec/rlogind/rlogind.c,v
retrieving revision 1.1.1.5
diff -c -r1.1.1.5 rlogind.c
*** rlogind.c	1998/08/11 13:36:09	1.1.1.5
--- rlogind.c	1998/08/24 15:08:37
***************
*** 383,394 ****
  			omask = &obits;
  		} else
  			FD_SET(f, &ibits);
! 		if (pcc >= 0)
  			if (pcc) {
  				FD_SET(f, &obits);
  				omask = &obits;
  			} else
  				FD_SET(p, &ibits);
  		FD_SET(p, &ebits);
  		if ((n = select(nfd, &ibits, omask, &ebits, 0)) < 0) {
  			if (errno == EINTR)
--- 383,395 ----
  			omask = &obits;
  		} else
  			FD_SET(f, &ibits);
! 		if (pcc >= 0) {
  			if (pcc) {
  				FD_SET(f, &obits);
  				omask = &obits;
  			} else
  				FD_SET(p, &ibits);
+ 		}
  		FD_SET(p, &ebits);
  		if ((n = select(nfd, &ibits, omask, &ebits, 0)) < 0) {
  			if (errno == EINTR)
Index: rmail/rmail.c
===================================================================
RCS file: /home/cvs-base/src/libexec/rmail/rmail.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 rmail.c
*** rmail.c	1997/10/20 21:38:23	1.1.1.3
--- rmail.c	1998/08/24 15:11:22
***************
*** 164,170 ****
  			}
  
  		/* Else use the string up to the last bang. */
! 		if (p == NULL)
  			if (*addrp == '!')
  				err(EX_DATAERR,
  				    "bang starts address: %s", addrp);
--- 164,170 ----
  			}
  
  		/* Else use the string up to the last bang. */
! 		if (p == NULL) {
  			if (*addrp == '!')
  				err(EX_DATAERR,
  				    "bang starts address: %s", addrp);
***************
*** 178,183 ****
--- 178,184 ----
  				if (debug)
  					(void)fprintf(stderr, "bang: %s\n", p);
  			}
+ 		}
  
  		/* 'p' now points to any system string from this line. */
  		if (p != NULL) {
>Audit-Trail:
>Unformatted: