Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c282cd8

Browse files
Remove temp buffer in WiFiClientSecure::lastError (#4822)
The temp buffer serves no purpose here. Also mbedtls_strerror can be called with size == 0 safely.
1 parent 7e59971 commit c282cd8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

‎libraries/WiFiClientSecure/src/WiFiClientSecure.cpp‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ int WiFiClientSecure::lastError(char *buf, const size_t size)
333333
if (!_lastError) {
334334
return 0;
335335
}
336-
char error_buf[100];
337-
mbedtls_strerror(_lastError, error_buf, 100);
338-
snprintf(buf, size, "%s", error_buf);
336+
mbedtls_strerror(_lastError, buf, size);
339337
return _lastError;
340338
}
341339

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /