[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #35852] fscanf does not read full file

From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #35852] fscanf does not read full file
Date: Wed, 23 May 2012 18:15:26 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20100101 Firefox/10.0.4 Iceweasel/10.0.4

Follow-up Comment #17, bug #35852 (project octave):

OK, it turns out that the bug reported to the mailing list (bug.m and bug.dat)
is not really a bug in Octave.  The script uses "%i:%i:%i" to parse times of
the form "06:08:30" and that fails because %i interprets hex, octal, and
decimal integers depending on the contents of the file that is being read. 
Hex numbers begin with 0x or 0X and octal numbers begin with 0.  So 08 is not
parsed as "8" but instead as 0 because it initially looks like an octal number
but 8 is not an octal digit.  This is not a bug.  If you want to always parse
decimal numbers, use '%d' instead of '%i'.

On a related note, while investigating this problem report, I did find a bug
with not properly ignoring leading whitespace when handling '%i' formats. 
That problem is fixed in the following changeset:



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]