Remove libbsd and strlcpy
This commit is contained in:
parent
3f11431df6
commit
1f315d2b92
15 changed files with 53 additions and 50 deletions
src
|
@ -1,4 +1,3 @@
|
|||
#include <bsd/string.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
@ -224,7 +223,8 @@ database_helper_get_string(sqlite3_stmt *stmt)
|
|||
free(result);
|
||||
}
|
||||
result = (char*)malloc(sizeof(char) * (found_string_len + 1));
|
||||
strlcpy(result, found_string, found_string_len + 1);
|
||||
strncpy(result, found_string, found_string_len);
|
||||
result[found_string_len] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -268,7 +268,8 @@ database_helper_get_strings(sqlite3_stmt *stmt)
|
|||
|
||||
result = (char**)realloc(result, sizeof(char*) * (row + 1));
|
||||
result[row - 1] = malloc(sizeof(char) * (new_string_len + 1));
|
||||
strlcpy(result[row - 1], new_string, new_string_len + 1);
|
||||
strncpy(result[row - 1], new_string, new_string_len);
|
||||
result[new_string_len] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue