From b56f0a6aa12616d83e6d0ff42a9e4cadd6ae873c Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 4 Aug 2019 12:45:17 +0200 Subject: [PATCH] IRSend handle index=0 --- sonoff/xdrv_05_irremote.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonoff/xdrv_05_irremote.ino b/sonoff/xdrv_05_irremote.ino index 400020922..a75efcbd4 100644 --- a/sonoff/xdrv_05_irremote.ino +++ b/sonoff/xdrv_05_irremote.ino @@ -755,7 +755,7 @@ uint32_t IrRemoteCmndIrSendRaw(void) } // repeat - uint16_t repeat = XdrvMailbox.index - 1; + uint16_t repeat = XdrvMailbox.index > 0 ? XdrvMailbox.index - 1 : 0; uint16_t freq = atoi(str); if (!freq && (*str != '0')) { // First parameter is any string