utils: fix incorrect string checks in meas_db_insert()

Comparing an array to null is not useful, since the test will
always evaluate as true (NO_EFFECT).

Change-Id: I8a41078070119bc22d594c0dfff5d98b5d16f970
Fixes: fbead4327 utils: store more fields from meas-feed in db
Fixes: CID#310821
This commit is contained in:
Vadim Yanitskiy 2023-03-01 13:36:14 +07:00 committed by fixeria
parent 111b13f9a2
commit 4a61575917
1 changed files with 3 additions and 3 deletions

View File

@ -94,19 +94,19 @@ int meas_db_insert(struct meas_db_state *st, unsigned long timestamp,
SCK_OK(st->db, sqlite3_bind_int(st->stmt_ins_mr, 6, mfm->lchan_type));
SCK_OK(st->db, sqlite3_bind_int(st->stmt_ins_mr, 7, mfm->pchan_type));
if (mfm->imsi)
if (mfm->imsi[0] != '\0')
SCK_OK(st->db, sqlite3_bind_text(st->stmt_ins_mr, 8,
mfm->imsi, -1, SQLITE_STATIC));
else
SCK_OK(st->db, sqlite3_bind_null(st->stmt_ins_mr, 8));
if (mfm->name)
if (mfm->name[0] != '\0')
SCK_OK(st->db, sqlite3_bind_text(st->stmt_ins_mr, 9,
mfm->name, -1, SQLITE_STATIC));
else
SCK_OK(st->db, sqlite3_bind_null(st->stmt_ins_mr, 9));
if (mfm->scenario)
if (mfm->scenario[0] != '\0')
SCK_OK(st->db, sqlite3_bind_text(st->stmt_ins_mr, 10,
mfm->scenario, -1, SQLITE_STATIC));
else