287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov/* $NetBSD: fgetln.c,v 1.3 2007/08/07 02:06:58 lukem Exp $ */
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * Copyright (c) 1998 The NetBSD Foundation, Inc.
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * All rights reserved.
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * This code is derived from software contributed to The NetBSD Foundation
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * by Christos Zoulas.
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * Redistribution and use in source and binary forms, with or without
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * modification, are permitted provided that the following conditions
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * 1. Redistributions of source code must retain the above copyright
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * notice, this list of conditions and the following disclaimer.
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * 2. Redistributions in binary form must reproduce the above copyright
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * notice, this list of conditions and the following disclaimer in the
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * documentation and/or other materials provided with the distribution.
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * 3. Neither the name of The NetBSD Foundation nor the names of its
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * contributors may be used to endorse or promote products derived
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * from this software without specific prior written permission.
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov * POSSIBILITY OF SUCH DAMAGE.
287247a826fa2ab8d01f6c8f276d405eb08420f8Alexander Pyhalov while ((ptr = strchr(&buf[*len], '\n')) == NULL) {