Remove libbsd and strlcpy

This commit is contained in:
Tobias Reisinger 2020-11-19 23:36:02 +01:00
parent 3f11431df6
commit 1f315d2b92
15 changed files with 53 additions and 50 deletions
src/models

View file

@ -1,4 +1,3 @@
#include <bsd/string.h>
#include <sqlite3.h>
#include <stdlib.h>
#include <string.h>
@ -55,7 +54,8 @@ relay_db_select_mapper(sqlite3_stmt *stmt)
switch(name[1])
{
case 'a': // name
strlcpy(new_relay->name, (const char*)sqlite3_column_text(stmt, i), sizeof(new_relay->name));
strncpy(new_relay->name, (const char*)sqlite3_column_text(stmt, i), MAX_NAME_LENGTH);
new_relay->name[MAX_NAME_LENGTH] = '\0';
break;
case 'u': // number
new_relay->number = sqlite3_column_int(stmt, i);