]> git.saurik.com Git - apple/network_cmds.git/blobdiff - traceroute.tproj/traceroute.c
network_cmds-606.100.3.tar.gz
[apple/network_cmds.git] / traceroute.tproj / traceroute.c
index eff6cec1708b12e93ecd7b7508587033d115a265..a411d0a4a9edf90ff9ade89cd9977440ed897a50 100644 (file)
@@ -1621,8 +1621,7 @@ inetname(struct in_addr in)
                                domain[0] = '\0';
                        else {
                                ++cp;
-                               (void)strncpy(domain, cp, sizeof(domain) - 1);
-                               domain[sizeof(domain) - 1] = '\0';
+                               memmove(domain, cp, strlen(cp) + 1);
                        }
                }
        }
@@ -1632,8 +1631,7 @@ inetname(struct in_addr in)
                        if ((cp = strchr(hp->h_name, '.')) != NULL &&
                            strcmp(cp + 1, domain) == 0)
                                *cp = '\0';
-                       (void)strncpy(line, hp->h_name, sizeof(line) - 1);
-                       line[sizeof(line) - 1] = '\0';
+                       (void)strlcpy(line, hp->h_name, sizeof(line));
                        return (line);
                }
        }