aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/network.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-12-09 08:22:19 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-12-09 08:22:19 +0000
commit00b69db338558f07cd23191647a641b53fded983 (patch)
tree703f1957c7cb4d3138f4dca933a94c51a76a6ae6 /usr.sbin/sysinstall/network.c
parent8bc3ddf57f95b8be12692eb1cc52d01bee4c7b1f (diff)
downloadsrc-00b69db338558f07cd23191647a641b53fded983.tar.gz
src-00b69db338558f07cd23191647a641b53fded983.zip
As Paul has just pointed out, much of my strncpy() usage was either
bogus or overly complex and really needed to be done more consistently and sanely throughout - no question about it. Done. Suggested-By: Paul Traina <pst@Shockwave.COM>
Notes
Notes: svn path=/head/; revision=20247
Diffstat (limited to 'usr.sbin/sysinstall/network.c')
-rw-r--r--usr.sbin/sysinstall/network.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c
index 0b20b121dfa4..a7ed90f1a3b3 100644
--- a/usr.sbin/sysinstall/network.c
+++ b/usr.sbin/sysinstall/network.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: network.c,v 1.19 1996/12/09 06:37:44 jkh Exp $
+ * $Id: network.c,v 1.20 1996/12/09 06:45:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -94,7 +94,7 @@ mediaInitNetwork(Device *dev)
if (!val)
return FALSE;
else
- strncpy(attach, val, 256);
+ SAFE_STRCPY(attach, val);
/*
* Doing this with vsystem() is actually bogus since we should be storing the pid of slattach
* for later killing. It's just too convenient to call vsystem(), however, rather than
@@ -198,15 +198,17 @@ startPPP(Device *devp)
"maximum data rate since most modems can talk at one speed to the\n"
"computer and at another speed to the remote end.\n\n"
"If you're not sure what to put here, just select the default.");
- strncpy(speed, (val && *val) ? val : "115200", 16);
+ SAFE_STRCPY(speed, (val && *val) ? val : "115200");
+
+ val = variable_get(VAR_GATEWAY);
+ SAFE_STRCPY(provider, (val && *val) ? val : "0");
- strncpy(provider, variable_get(VAR_GATEWAY) ? variable_get(VAR_GATEWAY) : "0", 16);
val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\n"
"don't know it and would prefer to negotiate it dynamically.");
- strncpy(provider, val ? val : "0", 16);
+ SAFE_STRCPY(provider, (val && *val) ? val : "0");
if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
- strncpy(myaddr, ((DevInfo *)devp->private)->ipaddr, 16);
+ SAFE_STRCPY(myaddr, ((DevInfo *)devp->private)->ipaddr);
else
strcpy(myaddr, "0");