From 59a04343b47717c042ccc3946d4e5b9b32266bf7 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 29 Oct 2019 11:39:13 -0400 Subject: [PATCH] TT#69550 silence stray warnings The DB schema allows for certain columns to be NULL. Handle this appropriately to elminiate failed assertions from g_strlcpy. Change-Id: I8768847b96b169dfad94b2ca448cc2af5058d38b --- medmysql.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/medmysql.c b/medmysql.c index 7a63454..d9bf0f1 100644 --- a/medmysql.c +++ b/medmysql.c @@ -615,9 +615,9 @@ int medmysql_fetch_records(med_callid_t *callid, g_strlcpy(e->callid, row[3], sizeof(e->callid)); g_strlcpy(e->timestamp, row[4], sizeof(e->timestamp)); e->unix_timestamp = atof(row[5]); - g_strlcpy(e->src_leg, row[6], sizeof(e->src_leg)); - g_strlcpy(e->dst_leg, row[7], sizeof(e->dst_leg)); - g_strlcpy(e->branch_id, row[8], sizeof(e->branch_id)); + g_strlcpy(e->src_leg, row[6] ? : "", sizeof(e->src_leg)); + g_strlcpy(e->dst_leg, row[7] ? : "", sizeof(e->dst_leg)); + g_strlcpy(e->branch_id, row[8] ? : "", sizeof(e->branch_id)); e->valid = 1; if (check_shutdown())