Remove libbsd and strlcpy
This commit is contained in:
parent
3f11431df6
commit
1f315d2b92
15 changed files with 53 additions and 50 deletions
src
|
@ -1,5 +1,3 @@
|
|||
#include <bsd/string.h>
|
||||
|
||||
#include <logger.h>
|
||||
#include <cJSON.h>
|
||||
#include <mongoose.h>
|
||||
|
@ -100,10 +98,9 @@ endpoint_response_text(endpoint_response_t *response, int status_code, const cha
|
|||
response->content_length = strlen(content);
|
||||
response->alloced_content = true;
|
||||
|
||||
int content_size = response->content_length + 1;
|
||||
|
||||
response->content = malloc(sizeof(char) * content_size);
|
||||
strlcpy(response->content, content, content_size);
|
||||
response->content = malloc(sizeof(char) * (response->content_length + 1));
|
||||
strcpy(response->content, content);
|
||||
response->content[response->content_length] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue