From mint-bounce@lists.fishpool.fi  Sun Oct 24 22:41:44 2004
X-Original-To: fnaumann@mail.boerde.de
Delivered-To: fnaumann@mail.boerde.de
Subject: [MiNT] Getline
From: Mark Duckworth <mduckworth@atari-source.com>
To: Mint List <mint@fishpool.com>
Content-Type: text/plain
Organization: Atari-source.com
Date: Sun, 24 Oct 2004 16:40:26 -0400
Message-Id: <1098650426.4497.2.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.2 
Content-Transfer-Encoding: 7bit
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-To: mint-bounce@lists.fishpool.fi
X-original-sender: mduckworth@atari-source.com
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
X-Virus-Scanned: by amavisd-new at relay.boerde.de
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de
X-Spam-Status: No, hits=0.5 tagged_above=-50.5 required=3.8 tests=BAYES_00,
 RCVD_NUMERIC_HELO
X-Spam-Level: 

Hello everyone,

I'm writing the new Sparemint Update Manager software.  One of the
things this software must do is read in a package database which it does
one line at a time. 

For some reason, getline is producing very inconsistent results.

I am using it as such:

while ((getline(&line, &len, fp))!=-1)
{
	// Do actions
	count++;
}

now the file that it's reading is 358 lines long.

Sometimes it will read 242 lines of this file.  Other times 301 lines of
this file.  I have verified the value getline is returning is indeed -1
for some reason before the end of the file which also indicates error.
But what error could I be getting?  Regardless I simply cannot get it to
read the entire file!  I'm not precisely sure what I'm doing wrong.  Any
ideas?

Thanks,
Mark


