aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/zpu/lib/hal_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/zpu/lib/hal_io.c')
-rw-r--r--firmware/zpu/lib/hal_io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/zpu/lib/hal_io.c b/firmware/zpu/lib/hal_io.c
index 4ed694b9d..d4be324f5 100644
--- a/firmware/zpu/lib/hal_io.c
+++ b/firmware/zpu/lib/hal_io.c
@@ -257,8 +257,9 @@ fngets_noblock(hal_uart_name_t u, char * const s, int len)
{
int i;
for(i=0; i < len; i++) {
- s[i] = (char) hal_uart_getc_noblock(u);
- if((s[i] == 255) || (s[i] == '\n')) break;
+ int ret = hal_uart_getc_noblock(u);
+ s[i] = (char) ret;
+ if((ret == -1) || (s[i] == '\n')) break;
}
s[i] = 0;