diff options
author | Rob Landley <rob@landley.net> | 2007-06-07 15:19:44 -0400 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-06-07 15:19:44 -0400 |
commit | 18d43ffd39dffec81f8ece68447692d6e2e4672a (patch) | |
tree | d84e2a81252374f48cfd3884416a5d94ec674fe3 /lib/lib.c | |
parent | 171af61b28c5ae5b3e073efbf7c4f87ce1d0fb20 (diff) | |
download | toybox-18d43ffd39dffec81f8ece68447692d6e2e4672a.tar.gz |
Work around uClibc weirdness.
Diffstat (limited to 'lib/lib.c')
-rw-r--r-- | lib/lib.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -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) { |