[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in 2.1.30 and 2.1.31 -- fscanf in "C" compatibility mode
From: |
Joao Cardoso |
Subject: |
Bug in 2.1.30 and 2.1.31 -- fscanf in "C" compatibility mode |
Date: |
Thu, 20 Jul 2000 16:19:08 +0100 |
Hi,
The following ilustrate the bug on a two line file:
---po----
One: 1
Two: 2
---------
octave:1> f=fopen("po","r");
octave:2> a=fscanf(f,"One: %d\n")
a = 1
octave:3> ftell(f)
ans = 7
octave:4> a=fscanf(f,"Two: %d\n")
a = 2
octave:5> frewind(f)
ans = 0
octave:6> a=fscanf(f,"One: %d\n","C")
a = 1
octave:7> ftell(f)
ans = -1
octave:8> frewind(f)
ans = 0
octave:9> a=fscanf(f,"One: %d","C")
a = 1
octave:10> ftell(f)
ans = -1
And thus the second file line can't be read.
If the file is read line by line with 'fgetl' and than 'sscanf',
everything is OK.
Joao
- Bug in 2.1.30 and 2.1.31 -- fscanf in "C" compatibility mode,
Joao Cardoso <=