summaryrefslogtreecommitdiffstats
path: root/release/sysinstall/misc.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-12-09 08:22:19 +0000
committerjkh <jkh@FreeBSD.org>1996-12-09 08:22:19 +0000
commit78cf4aee6b346217e9f9fbee836c6c67a8cbda61 (patch)
tree703f1957c7cb4d3138f4dca933a94c51a76a6ae6 /release/sysinstall/misc.c
parent316f6be0fa40f1f38890e5f7030d808f4de39e18 (diff)
downloadFreeBSD-src-78cf4aee6b346217e9f9fbee836c6c67a8cbda61.zip
FreeBSD-src-78cf4aee6b346217e9f9fbee836c6c67a8cbda61.tar.gz
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>
Diffstat (limited to 'release/sysinstall/misc.c')
-rw-r--r--release/sysinstall/misc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/release/sysinstall/misc.c b/release/sysinstall/misc.c
index 1dfc30d..17ce8eb 100644
--- a/release/sysinstall/misc.c
+++ b/release/sysinstall/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.21 1996/07/08 08:54:30 jkh Exp $
+ * $Id: misc.c,v 1.22 1996/07/09 14:28:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -76,6 +76,14 @@ string_concat(char *one, char *two)
return tmp;
}
+/* sane strncpy() function */
+char *
+sstrncpy(char *dst, const char *src, int size)
+{
+ *(dst + size) = '\0';
+ return strncpy(dst, src, size - 1);
+}
+
/* Concatenate three strings into static storage */
char *
string_concat3(char *one, char *two, char *three)
OpenPOWER on IntegriCloud