From owner-freebsd-questions@FreeBSD.ORG Sat Feb 18 17:54:27 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F9C816A420 for ; Sat, 18 Feb 2006 17:54:27 +0000 (GMT) (envelope-from freebsd@voidmain.net) Received: from pgh.nepinc.com (pgh.nepinc.com [66.207.129.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53C2143D6E for ; Sat, 18 Feb 2006 17:54:24 +0000 (GMT) (envelope-from freebsd@voidmain.net) Received: from [192.168.1.108] (monrovll-cuda1-68-170-0-189.pittpa.adelphia.net [68.170.0.189]) (authenticated bits=0) by pgh.nepinc.com (8.12.11/8.12.11) with ESMTP id k1IHsMB1095022; Sat, 18 Feb 2006 12:54:22 -0500 (EST) (envelope-from freebsd@voidmain.net) Message-ID: <43F75F3C.7080903@voidmain.net> Date: Sat, 18 Feb 2006 12:54:04 -0500 From: Tom Grove Organization: VoidMain.net User-Agent: Thunderbird 1.5 (X11/20060210) MIME-Version: 1.0 To: Chuck Swiger References: <43F68C7D.9010403@voidmain.net> <1140233843.982.21.camel@chaucer.jeays.ca> <43F74361.90109@voidmain.net> <43F75DF6.3050903@mac.com> In-Reply-To: <43F75DF6.3050903@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: getline function X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd@voidmain.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2006 17:54:27 -0000 Chuck Swiger wrote: > Tom Grove wrote: > >> Mike Jeays wrote: >> > [ ... ] > >> That works and I had looked into that earlier...it seems like it does a >> lot more than just one function from the man page. I guess I can use >> that for now but I wonder why getline() is broken in gcc on FreeBSD? >> > > getline() is not part of the standard C library. > What makes you think gcc is broken...? > > Yeah...I see that after some more research. So, now I guess my question is being that it's not standard and gets() is not safe to use what should I use to grab lines? My gut tells me to copy the getline() function from the K&R book but I'm not totally sure that's a great idea either. Stupid strings always causing problems! -Tom