Skip to content

Commit 565f8d1

Browse files
committed
Access array entry directly for termination instead of memset
1 parent 2cde164 commit 565f8d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/http_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int16_t HttpClientClass::readBody(char *buffer, const uint32_t buffer_size) {
296296
size_t response_length = strlen(buffer);
297297

298298
// Remove extra <CR> from command response
299-
memset(buffer + response_length - 1, 0, 1);
299+
buffer[response_length - 1] = '\0';
300300

301301
return response_length - 1;
302302
}

0 commit comments

Comments
 (0)