[HTTP] Fixes from cppcheck scan

This commit is contained in:
jgromes 2020-07-04 15:29:37 +02:00
parent 0c7f597b7f
commit f394912c92
2 changed files with 2 additions and 2 deletions

View file

@ -142,7 +142,7 @@ int16_t HTTPClient::post(const char* url, const char* content, String& response,
// build the POST request
char contentLengthStr[12];
sprintf(contentLengthStr, "%d", strlen(content));
sprintf(contentLengthStr, "%u", (uint16_t)strlen(content));
char* request = new char[strlen(endpoint) + strlen(host) + strlen(contentType) + strlen(contentLengthStr) + strlen(content) + 64 + 1];
strcpy(request, "POST ");
strcat(request, endpoint);

View file

@ -19,7 +19,7 @@ class HTTPClient {
\param port Port to be used for HTTP. Defaults to 80.
*/
HTTPClient(TransportLayer* tl, uint16_t port = 80);
explicit HTTPClient(TransportLayer* tl, uint16_t port = 80);
/*!
\brief Sends HTTP GET request.