]> granicus.if.org Git - sysstat/commitdiff
Use memcpy rather than strncpy, in order to avoid truncation warning
authorstevekay <stevekay@gmail.com>
Thu, 22 Nov 2018 22:38:45 +0000 (17:38 -0500)
committerstevekay <stevekay@gmail.com>
Thu, 22 Nov 2018 22:38:45 +0000 (17:38 -0500)
rd_stats.c

index b8b5072f461bedb3e187007f62e9cc83be6002e7..0b462a6d6ce3f45b9f73b031c9f7453c52bf6f13 100644 (file)
@@ -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';
                }
        }