Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit d0d5232

Browse files
author
Seppo Takalo
committed
User strlen() instead of sizeof for calculating string length
HTTP protocol considers character values 0-31 and 127 to be US-ASCII control characters and are not allowed if request headers. Fixes #31
1 parent c1dd311 commit d0d5232

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void http_demo(NetworkInterface *net)
101101

102102
// Send a simple http request
103103
char sbuffer[] = "GET / HTTP/1.1\r\nHost: www.arm.com\r\n\r\n";
104-
nsapi_size_t size = sizeof sbuffer;
104+
nsapi_size_t size = strlen(sbuffer);
105105
response = 0;
106106
while(size)
107107
{

0 commit comments

Comments
 (0)