cvs commit: src/sbin/nologin Makefile nologin.c nologin.sh

David Schultz das at FreeBSD.ORG
Mon Nov 17 01:23:09 PST 2003


On Sun, Nov 16, 2003, Nate Lawson wrote:
> On Sun, 16 Nov 2003, David Schultz wrote:
> > +#define	MESSAGE	"This account is currently not available.\n"
> > +
> > +int
> > +main(int argc, char *argv[])
> > +{
> > +
> > +	write(STDOUT_FILENO, MESSAGE, sizeof(MESSAGE));
> > +	_exit(1);
> > +}
> 
> Shouldn't that be strlen(MESSAGE) since sizeof includes the terminating
> '\0'?
> 
> I couldn't help pointing out a bug in a variant of Hello World.  ;-)

Shhh!  In an attempt to save face, I'm calling it a feature.


More information about the cvs-src mailing list