Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jan 1997 12:40:52 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        joerg_wunsch@uriah.heep.sax.de
Cc:        hackers@freebsd.org
Subject:   Re: number of lines in a file, given its size
Message-ID:  <199701111940.MAA24017@phaeton.artisoft.com>
In-Reply-To: <Mutt.19970111132023.j@uriah.heep.sax.de> from "J Wunsch" at Jan 11, 97 01:20:23 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > In line 115 in /usr/src/lib/libc/gen/getusershell.c:
> > 
> >     shells = calloc((unsigned)statb.st_size / 3, sizeof (char *));  
> >                               ^^^^^^^^^^^^^^^^^                     
> > Isn't this a suspicious approximation of the number of lines in /etc/shells
> > (just put `/' in it for example of an invalid entry).
> 
> You are certainly right, but i think that's a moot point basically.
> It requires you at least the following file in order to break:

strdup() to the rescue! ...


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701111940.MAA24017>