altos: ao_packet_getchar needs to return 'int' so AO_READ_AGAIN works
authorKeith Packard <keithp@keithp.com>
Sat, 7 Feb 2015 21:09:18 +0000 (13:09 -0800)
committerKeith Packard <keithp@keithp.com>
Sat, 7 Feb 2015 21:09:18 +0000 (13:09 -0800)
With ao_packet_getchar returning 'char', AO_READ_AGAIN would get
converted to 0xff instead of -1 on return, making ao_packet_echo
either produce a bogus character on output, breaking command
responses, or wedge and never exit when the link was dropped.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_packet_master.c

index 2354504981d6f09d3b51046d02fab1e300bc6b3a..42a4f5bfd35f064f22aa9cd682aa5295a897fe3b 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "ao.h"
 
 
 #include "ao.h"
 
-static char
+static int
 ao_packet_getchar(void)
 {
        int c;
 ao_packet_getchar(void)
 {
        int c;