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

Re: [MiNT] Gluestik: CNbyte_count() bug?



Bonsoir Roger,

Thanks for the explanation.

Can't make STinG's CNget_NDB() work without crash, so I have to use the MiNTnet API. Time to write additionnal code. Gluestick will be still needed for the resolver (has someone got the idea to code a resolver.ldg using several tcp/ip layers such as MiNTnet and STinG?).

Meanwhile, Litchi is not safe under MiNT with quick ethernet and cpu.

Regards,

Pierre
http://rajah.atari.org


Le 05/01/13 20:59, Roger Burrows a écrit :
Hi Pierre,
On 5 Jan 2013 at 3:28, Pierre Ton-That wrote:
gs_stik.c:
static int16 do_CNbyte_count (struct CNbyte_count_param p) { return
gs_canread (p.fd); }

gs_func.c:
long gs_canread (int fd) { ... }

Is this a bug?
It certainly looks like a bug.  The 32-bit return value from gs_canread()
will be truncated to a 16-bit value by do_CNbyte_count().  If that 32-bit value
has the 0x8000 bit set, it will look like an error return code from
do_CNbyte_count().