From e115c8d6668f23fba3a09e6f1619792a6e4a509d Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 10 Nov 2019 16:18:19 +0100 Subject: [PATCH] Aircon: Do not crash on receiving 0x00 on debug USART This happens during initialization if the debug port is not connected. --- aircon/firmware/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aircon/firmware/main.c b/aircon/firmware/main.c index c430121..129ac71 100644 --- a/aircon/firmware/main.c +++ b/aircon/firmware/main.c @@ -347,6 +347,8 @@ static bool rc_send(char key) { if (rc_pending) return false; + if (!key) + return false; const char *s = strchr(rc_keys, key); if (!s) -- 2.39.5