Skip to content

Commit 1c19471

Browse files
committed
Eliminate usages of strlen
1 parent d685890 commit 1c19471

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/webserver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ int webserver::build_request_args (
496496
details::modded_request* mr = static_cast<details::modded_request*>(cls);
497497
std::string value = ((arg_value == NULL) ? "" : arg_value);
498498
{
499-
char buf[strlen(key) + value.size() + 3];
499+
char buf[std::string(key).size() + value.size() + 3];
500500
if(mr->dhr->querystring == "")
501501
{
502502
snprintf(buf, sizeof buf, "?%s=%s", key, value.c_str());
@@ -557,7 +557,7 @@ size_t unescaper_func(void * cls, struct MHD_Connection *c, char *s)
557557
// IT IS DUE TO A BOGUS ON libmicrohttpd (V0.99) THAT PRODUCING A
558558
// STRING CONTAINING '\0' AFTER AN UNESCAPING, IS UNABLE TO PARSE
559559
// ARGS WITH get_connection_values FUNC OR lookup FUNC.
560-
return strlen(s);
560+
return std::string(s).size();
561561
}
562562

563563
size_t internal_unescaper(void* cls, std::string& s)

0 commit comments

Comments
 (0)