🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.4bsd
Article #1603

"mille" still isn't type-correct

#1603
From: Guy Harris
Date: Wed, 30 Jul 1986 21:11
58 lines
2097 bytes
Index:	games/mille/mille.c games/mille/move.c 4.3BSD

Description:
	"NULL" is defined as 0, which is an integral type.  The
	second argument to "setbuf" should be of type "char *".
	Thus, "NULL" by itself is not the correct argument to
	"setbuf".
Repeat-By:
	Try "lint"ing "mille".  If it passes, either your "lint" is
	wrong (some S5 versions allow that sort of bullshit, but
	they shouldn't) or your definition of NULL is wrong (it
	should NOT be defined as "(char *)0", since that causes
	problems if you want to pass a null pointer of another type).
Fix:

*** /arch/4.3/usr/src/games/mille/mille.c	Sat Jan 11 11:47:31 1986
--- mille/mille.c	Tue Jul 29 15:27:32 1986
***************
*** 21,27 ****
  
  	if (strcmp(av[0], "a.out") == 0) {
  		outf = fopen("q", "w");
! 		setbuf(outf, NULL);
  		Debug = TRUE;
  	}
  	restore = FALSE;
--- 21,27 ----
  
  	if (strcmp(av[0], "a.out") == 0) {
  		outf = fopen("q", "w");
! 		setbuf(outf, (char *)NULL);
  		Debug = TRUE;
  	}
  	restore = FALSE;

*** /arch/4.3/usr/src/games/mille/move.c	Wed Jan 22 16:32:18 1986
--- mille/move.c	Tue Jul 29 15:28:31 1986
***************
*** 406,412 ****
  					leaveok(Board, TRUE);
  					if ((outf = fopen(buf, "w")) == NULL)
  						perror(buf);
! 					setbuf(outf, NULL);
  				}
  				Debug = !Debug;
  				break;
--- 406,412 ----
  					leaveok(Board, TRUE);
  					if ((outf = fopen(buf, "w")) == NULL)
  						perror(buf);
! 					setbuf(outf, (char *)NULL);
  				}
  				Debug = !Debug;
  				break;
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)
Technical Details
Message-ID: <5668@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!pyramid!decwrl!sun!guy

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!pyramid!decwrl!sun!guy
From: guy@sun.uucp (Guy Harris)
Newsgroups: net.bugs.4bsd
Subject: "mille" still isn't type-correct
Message-ID: <5668@sun.uucp>
Date: Wed, 30-Jul-86 17:11:26 EDT
Article-I.D.: sun.5668
Posted: Wed Jul 30 17:11:26 1986
Date-Received: Thu, 31-Jul-86 21:43:22 EDT
Distribution: net
Organization: Sun Microsystems, Inc.
Lines: 58