Skip to content

Commit 5a0d773

Browse files
committed
Merge pull request arduino#57 from tekka007/Hotfix
Fixing endless loop
2 parents 23e5d5f + a6301f8 commit 5a0d773

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/MySensors/MySensor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,10 @@ boolean MySensor::process() {
353353
if (repeaterMode && msg.getString()[0] == 'C') {
354354
// Clears child relay data for this node
355355
debug(PSTR("rd=clear\n"));
356-
for (uint8_t i=0;i< 256; i++) {
356+
uint8_t i = 255;
357+
do {
357358
removeChildRoute(i);
358-
}
359+
} while (i--);
359360
// Clear parent node id & distance to gw
360361
eeprom_write_byte((uint8_t*)EEPROM_PARENT_NODE_ID_ADDRESS, 0xFF);
361362
eeprom_write_byte((uint8_t*)EEPROM_DISTANCE_ADDRESS, 0xFF);

0 commit comments

Comments
 (0)