]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
strncpy -> strlcpy.
authorRoy Marples <roy@marples.name>
Tue, 2 Sep 2008 15:07:01 +0000 (15:07 +0000)
committerRoy Marples <roy@marples.name>
Tue, 2 Sep 2008 15:07:01 +0000 (15:07 +0000)
dhcpcd.c
net.c

index c450217e0c612dbaa47cb613315577b000441cac..96d8cf709ae4f3aa417326a6694fc4dd66340ff5 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -759,7 +759,7 @@ main(int argc, char **argv)
        /* Saves calling fflush(stream) in the logger */
        setlinebuf(stdout);
        openlog(PACKAGE, LOG_PID, LOG_LOCAL0);
-       strncpy(cffile, CONFIG, sizeof(cffile));
+       strlcpy(cffile, CONFIG, sizeof(cffile));
 
        /* Test for --help and --version */
        if (argc > 1) {
diff --git a/net.c b/net.c
index 10612961adfbc234b1a5f694069fdf1706a373c8..917d29ef5fe535bf494233d6f2e76252af3230e4 100644 (file)
--- a/net.c
+++ b/net.c
@@ -481,7 +481,7 @@ carrier_status(const char *ifname)
 #ifdef SIOCGIFMEDIA
        if (retval == 1) {
                memset(&ifmr, 0, sizeof(ifmr));
-               strncpy(ifmr.ifm_name, ifr.ifr_name, sizeof(ifmr.ifm_name));
+               strlcpy(ifmr.ifm_name, ifr.ifr_name, sizeof(ifmr.ifm_name));
                if (ioctl(s, SIOCGIFMEDIA, &ifmr) != -1 &&
                    ifmr.ifm_status & IFM_AVALID)
                {