[Vala] Is this a bug or a feature?

2009-03-20 Thread Barry Kauler
I have this simple code, in Genie syntax: init var f = FileStream.open(/tmp/0setup-raw-db,r) var a = new array of char[2048] while f.eof() != true f.gets(a) /*read one line from file*/ a[a.length - 1] = 0 /*make it

Re: [Vala] Is this a bug or a feature?

2009-03-20 Thread Nicolas Joseph
Hello, Attention, the function feof (in C) should not be used to check the end of a file: http://c-faq.com/stdio/feof.html The correct code: [indent=2] init var f = FileStream.open(./main.gs,r) var a = new array of char[2048] while (f.gets(a) != null) a[a.length - 1] = 0 /*make

Re: [Vala] Is this a bug or a feature?

2009-03-20 Thread Jamie McCracken
On Sat, 2009-03-21 at 00:27 +0100, Nicolas Joseph wrote: Hello, Attention, the function feof (in C) should not be used to check the end of a file: http://c-faq.com/stdio/feof.html The correct code: [indent=2] init var f = FileStream.open(./main.gs,r) var a = new array of