Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-02-14 11:11:27 +0300
committerEric Andersen <andersen@codepoet.org>2001-02-14 11:11:27 +0300
commitec455953008d08f588fe0c0bd9df4278cd188315 (patch)
treeece4d8fefb69365210a9e623df07b41086cd5613 /utility.c
parent88a5ceb450b576558b7d34e0baadb204dd329fb8 (diff)
Add in ifconfig and route
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/utility.c b/utility.c
index f3c184e73..368dfc5fe 100644
--- a/utility.c
+++ b/utility.c
@@ -1377,6 +1377,14 @@ extern char * xstrndup (const char *s, int n) {
}
#endif
+#if defined BB_IFCONFIG || defined BB_ROUTE
+/* Like strncpy but make sure the resulting string is always 0 terminated. */
+extern char * safe_strncpy(char *dst, const char *src, size_t size)
+{
+ dst[size-1] = '\0';
+ return strncpy(dst, src, size-1);
+}
+#endif
#if (__GLIBC__ < 2) && (defined BB_SYSLOGD || defined BB_INIT)
extern int vdprintf(int d, const char *format, va_list ap)