Commit cb15dc24 authored by Lehner Florian's avatar Lehner Florian

fix issues caused by replaceing strcpy() with safe_strncpy()

Signed-off-by: default avatarLehner Florian <dev@der-flo.net>
parent 604785ad
......@@ -109,14 +109,15 @@ int rprint_fib(int ext, int numeric)
sin_netmask = (struct sockaddr_in *)&snet_mask;
safe_strncpy(net_addr, INET_sprintmask(&snet_target,
(numeric | 0x8000 | (iflags & RTF_HOST? 0x4000: 0)),
sin_netmask->sin_addr.s_addr),
sizeof(net_addr));
sin_netmask->sin_addr.s_addr), sizeof(net_addr));
net_addr[15] = '\0';
safe_strncpy(gate_addr, inet_aftype.sprint(&snet_gateway, numeric | 0x4000),
sizeof(gate_addr));
gate_addr[15] = '\0';
safe_strncpy(mask_addr, inet_aftype.sprint(&snet_mask, 1),
sizeof(mask_addr));
safe_strncpy(mask_addr, inet_aftype.sprint(&snet_mask, 1), sizeof(mask_addr));
mask_addr[15] = '\0';
/* Decode the flags. */
flags[0] = '\0';
......
......@@ -136,10 +136,8 @@ int main(int argc, char **argv)
/* getopts and -net wont work :-/ */
for (tmp = argv; *tmp; tmp++) {
if (!strcmp(*tmp, "-net"))
safe_strncpy(*tmp, "#net", sizeof(*tmp));
else if (!strcmp(*tmp, "-host"))
safe_strncpy(*tmp, "#host", sizeof(*tmp));
if (!strcmp(*tmp, "-net") || !strcmp(*tmp, "-host"))
(*tmp)[0]='#';
}
/* Fetch the command-line arguments. */
......
......@@ -609,7 +609,7 @@ version(void)
int
main(int argc, char *argv[])
{
char path_buf[128];
char path_buf[128] = "";
char *path_dev;
char buff[128];
const char *speed = NULL;
......@@ -621,7 +621,6 @@ main(int argc, char *argv[])
{ NULL, 0, NULL, 0 }
};
safe_strncpy(path_buf, "", sizeof(path_buf));
path_dev = path_buf;
/* Scan command line for any arguments. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment