From 3f032ebdfc58608c2f02d379fd67a9ab79845e83 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Thu, 6 Nov 2014 23:32:49 -0500 Subject: use strncpy we already have it --- fsbm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsbm.c b/fsbm.c index 5f7d5c1..d099640 100644 --- a/fsbm.c +++ b/fsbm.c @@ -130,7 +130,7 @@ skip: printf(")\t"); // update our interface - strcpy(interfaces[i].interface, name); + strncpy(interfaces[i].interface, name, len); interfaces[i].rx_bytes = rx_bytes; interfaces[i].timestamp = timestamp; interfaces[i].tx_bytes = tx_bytes; @@ -161,7 +161,7 @@ int main(int argc, char **argv) { int c; int interval = 10 * 100000; - while ((c = getopt (argc, argv, "brd:hv")) != -1) + while ((c = getopt (argc, argv, "bd:hv")) != -1) switch (c) { case 'b': -- cgit v1.2.3