Skip to content

Commit d74f41d

Browse files
committed
oappendi: fix stack corruption due to large numbers (ESP32 only)
1 parent 5611a54 commit d74f41d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wled00/util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ void sappends(char stype, const char* key, char* val)
139139

140140
bool oappendi(int i)
141141
{
142-
char s[11];
143-
sprintf(s, "%d", i);
142+
char s[16]; // WLEDMM max 32bit integer needs 11 chars (sign + 10) not 10
143+
snprintf(s, 15, "%d", i); // WLEDMM
144144
return oappend(s);
145145
}
146146

0 commit comments

Comments
 (0)