fix: strncpy limits

This commit is contained in:
Tobias Reisinger 2019-07-30 13:22:19 +02:00
parent 831291cdac
commit fc0e0b660a
3 changed files with 9 additions and 9 deletions

View file

@ -40,10 +40,10 @@ relay_db_select_mapper(sqlite3_stmt *stmt)
switch(name[0])
{
case 'a': // active_schedule_id
strncpy(new_relay->active_schedule_id, (const char*)sqlite3_column_text(stmt, i), 33);
strncpy(new_relay->active_schedule_id, (const char*)sqlite3_column_text(stmt, i), 32);
break;
case 'c': // controller_id
strncpy(new_relay->controller_id, (const char*)sqlite3_column_text(stmt, i), 33);
strncpy(new_relay->controller_id, (const char*)sqlite3_column_text(stmt, i), 32);
break;
case 'i':
new_relay->id = sqlite3_column_int(stmt, i);