[En-Nut-Discussion] Reading from file
Maciek
arrenn at poczta.onet.pl
Thu Oct 4 17:18:44 CEST 2007
Thx for help! It really works! But there is another problem...
If you take a look at my first post about reading from file, then you can
see, that I commented one line - it is that one with fwrite function. So...
if I uncomment that line then 12 first characters are displayed (including
"\n" and "\r") and after that my whole device restarts. I really don't know
why.
Any ideas?
Thx!
Maciek
----- Original Message -----
From: "Harald Kipp" <harald.kipp at egnite.de>
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Sent: Thursday, October 04, 2007 9:09 AM
Subject: Re: [En-Nut-Discussion] Reading from file
Oops, I forgot
n = _read(fd, data, size - 1);
Harald Kipp schrieb:
> Maciek,
>
> you missed to add the terminating '\x00' character.
>
> Maciek schrieb:
>
>> n = _read(fd, data, size);
>>
>>
> data[n] = 0;
>
>> fprintf_P(stdout, PSTR("%s"), data);
>>
>>
> Harald
>
> PS. please send plain text to the list. See
> http://www.expita.com/nomime.html
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
--
egnite Software GmbH
Erinstr. 9
44575 Castrop-Rauxel
Germany
Fon +49 (0)23 05-44 12 56
Fax +49 (0)23 05-44 14 87
http://www.egnite.de/
http://www.ethernut.de/
Handelsregister: Amtsgericht Dortmund HRB 19783
USt-IdNr.: DE 189520047
Geschäftsführung: Harald Kipp
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
More information about the En-Nut-Discussion
mailing list