Skip to content

Commit 79bd106

Browse files
1010101001010101Anas Nashif
authored andcommitted
samples/net/http_client: Cast size_t to int to avoid compiler warnings
Cast size_t to int in the http_client_cb code. Jira: ZEP-1872 Change-Id: I36133da953669ec133421b5e7fb21bec9807fd06 Signed-off-by: Flavio Santes <[email protected]> (cherry picked from commit 4b92c9014e931680aa074d0eeaea9ffca4493d3b)
1 parent 75d045c commit 79bd106

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/net/http_client/src/http_client_cb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ int on_url(struct http_parser *parser, const char *at, size_t length)
1616
{
1717
ARG_UNUSED(parser);
1818

19-
printf("URL: %.*s\n", length, at);
19+
printf("URL: %.*s\n", (int)length, at);
2020

2121
return 0;
2222
}
@@ -49,7 +49,7 @@ int on_header_field(struct http_parser *parser, const char *at, size_t length)
4949
ctx->cl_present = 1;
5050
}
5151

52-
printf("%.*s: ", length, at);
52+
printf("%.*s: ", (int)length, at);
5353

5454
return 0;
5555
}
@@ -78,7 +78,7 @@ int on_header_value(struct http_parser *parser, const char *at, size_t length)
7878
ctx->cl_present = 0;
7979
}
8080

81-
printf("%.*s\n", length, at);
81+
printf("%.*s\n", (int)length, at);
8282

8383
return 0;
8484
}

0 commit comments

Comments
 (0)