Add clang-tidy target and fix problems
This commit is contained in:
parent
fca35ade9e
commit
f97b149376
25 changed files with 199 additions and 115 deletions
src
|
@ -1,3 +1,4 @@
|
|||
#include <bsd/string.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <logger.h>
|
||||
|
@ -341,8 +342,9 @@ router_find_endpoint(const char *uri_str, size_t uri_len, struct mg_str *method_
|
|||
{
|
||||
if(best_endpoint->args[i].type == ENDPOINT_ARG_TYPE_STR)
|
||||
{
|
||||
char *arg_value_str = malloc(sizeof(char) * (strlen(best_endpoint->args[i].value.v_str) + 1));
|
||||
strcpy(arg_value_str, best_endpoint->args[i].value.v_str);
|
||||
size_t arg_value_str_len = strlen(best_endpoint->args[i].value.v_str);
|
||||
char *arg_value_str = malloc(sizeof(char) * (arg_value_str_len + 1));
|
||||
strlcpy(arg_value_str, best_endpoint->args[i].value.v_str, arg_value_str_len);
|
||||
best_endpoint->args[i].value.v_str = arg_value_str;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue