aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 1f37eb59..8430ae68 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -11,6 +11,19 @@
#include "toys.h"
+#ifndef __UCLIBC__
+
+// uClibc has this, and if we define our own it conflicts.
+
+// Like strncpy but always null terminated.
+void strlcpy(char *dest, char *src, size_t size)
+{
+ strncpy(dest,src,size);
+ dest[size-1] = 0;
+}
+#endif
+
+
void verror_msg(char *msg, int err, va_list va)
{
fprintf(stderr, "%s: ", toys.which->name);
@@ -68,13 +81,6 @@ void usage_exit(void)
exit(1);
}
-// Like strncpy but always null terminated.
-void strlcpy(char *dest, char *src, size_t size)
-{
- strncpy(dest,src,size);
- dest[size-1] = 0;
-}
-
// Die unless we can allocate memory.
void *xmalloc(size_t size)
{