diff options
author | jkh <jkh@FreeBSD.org> | 1996-12-09 08:22:19 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-12-09 08:22:19 +0000 |
commit | 78cf4aee6b346217e9f9fbee836c6c67a8cbda61 (patch) | |
tree | 703f1957c7cb4d3138f4dca933a94c51a76a6ae6 /usr.sbin/sysinstall/misc.c | |
parent | 316f6be0fa40f1f38890e5f7030d808f4de39e18 (diff) | |
download | FreeBSD-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 'usr.sbin/sysinstall/misc.c')
-rw-r--r-- | usr.sbin/sysinstall/misc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c index 1dfc30d..17ce8eb 100644 --- a/usr.sbin/sysinstall/misc.c +++ b/usr.sbin/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) |