Skip to content

Commit 52f7538

Browse files
committed
Initialize newResponse because PAYLOAD_LEN is not a compile time constant
1 parent e2cc873 commit 52f7538

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/ELMduino.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,9 @@ void ELM327::parseMultiLineResponse() {
26102610
uint8_t totalBytes = 0;
26112611
uint8_t bytesReceived = 0;
26122612
bool headerFound = false;
2613-
char newResponse[PAYLOAD_LEN] = {0};
2613+
char newResponse[PAYLOAD_LEN];
2614+
memset(newResponse, 0, PAYLOAD_LEN * sizeof(char)); // Initialize newResponse to empty string
2615+
26142616
char line[256] = "";
26152617
char* start = payload;
26162618
char* end = strchr(start, '\r');

0 commit comments

Comments
 (0)