This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Problem with SCANF function
- From: bkankur <connintel at gmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Fri, 12 Mar 2010 05:59:29 -0800 (PST)
- Subject: [ECOS] Problem with SCANF function
Dear Friends,
I am using polling based serial driver by specifying buffer size(cbuf->len)
to zero through configuration tool.
When I call scanf function from application layer, I found that it is
calling serial_read function from file
packages\io\serial\current\src\common\serial.c.
For given function, static Cyg_ErrNo serial_read(cyg_io_handle_t handle,
void *_buf, cyg_uint32 *len)
I printed the argument values and found that *len=-1, which makes "while
(size++ < *len) " condition true always and my program gets stuck there.
I did similar thing for serial_write and I got *len value correct when I
call Printf function from user application.
I try to debug the /libc/sdio/current/src/input/scanf.cxx, but I couldn't
understand it. Can anyone please guide me where to look at for the error, in
my case *len = -1 which should be greater than 1 ?
Thank you,
Have a Good Day,
Ankur.
--
View this message in context: http://old.nabble.com/Problem-with-SCANF-function-tp27874746p27874746.html
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss