From e3b00fb056d2d844e2001d66e878b2f4ae2ca71c Mon Sep 17 00:00:00 2001 From: stevekay Date: Thu, 22 Nov 2018 17:38:45 -0500 Subject: [PATCH] Use memcpy rather than strncpy, in order to avoid truncation warning --- rd_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rd_stats.c b/rd_stats.c index b8b5072..0b462a6 100644 --- a/rd_stats.c +++ b/rd_stats.c @@ -2594,7 +2594,7 @@ __nr_t read_fchost(struct stats_fchost *st_fc, __nr_t nr_alloc) st_fc_i->f_txframes = tx_frames; st_fc_i->f_rxwords = rx_words; st_fc_i->f_txwords = tx_words; - strncpy(st_fc_i->fchost_name, drd->d_name, MAX_FCH_LEN); + memcpy(st_fc_i->fchost_name, drd->d_name, MAX_FCH_LEN); st_fc_i->fchost_name[MAX_FCH_LEN - 1] = '\0'; } } -- 2.40.0