From: stevekay Date: Thu, 22 Nov 2018 22:38:45 +0000 (-0500) Subject: Use memcpy rather than strncpy, in order to avoid truncation warning X-Git-Tag: v12.1.2~21^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3b00fb056d2d844e2001d66e878b2f4ae2ca71c;p=sysstat Use memcpy rather than strncpy, in order to avoid truncation warning --- 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'; } }