diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-23 21:38:00 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-23 21:38:00 +0000 |
commit | d254189b38bb5b0b77a18a401c05c415ce0733c9 (patch) | |
tree | 7a0a2dfa9e20a356bc0ba94eb20a26bef0c353d1 /newlib/libc/string/strndup.c | |
parent | 5e50e4e45c1f8758d431a6d881cd3da5572e8de7 (diff) | |
download | cygnal-d254189b38bb5b0b77a18a401c05c415ce0733c9.tar.gz cygnal-d254189b38bb5b0b77a18a401c05c415ce0733c9.tar.bz2 cygnal-d254189b38bb5b0b77a18a401c05c415ce0733c9.zip |
2002-07-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/string.h: Add mempcpy, strndup, and _strndup_r
prototypes.
* libc/stdlib/Makefile.am: Remove strdup.c and strdup_r.c.
* libc/stdlib/Makefile.in: Regenerated.
* libc/stdlib/strdup.c: Removed.
* libc/stdlib/strdup_r.c: Removed.
* libc/string/Makefile.am: Add strdup.c, strdup_r.c, memccpy.c,
mempcpy.c, strndup.c, and strndup_r.c.
* libc/string/Makefile.in: Regenerated.
* libc/string/memccpy.c: New file.
* libc/string/mempcpy.c: Ditto.
* libc/string/strndup.c: Ditto.
* libc/string/strndup_r.c: Ditto.
* libc/string/strdup.c: New file moved from stdlib.
* libc/string/strdup_r.c: Ditto.
* libc/string/strings.tex: Add memccpy and mempcpy documentation.
Diffstat (limited to 'newlib/libc/string/strndup.c')
-rw-r--r-- | newlib/libc/string/strndup.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/newlib/libc/string/strndup.c b/newlib/libc/string/strndup.c new file mode 100644 index 000000000..caa1b68b7 --- /dev/null +++ b/newlib/libc/string/strndup.c @@ -0,0 +1,16 @@ +#ifndef _REENT_ONLY + +#include <_ansi.h> +#include <reent.h> +#include <stdlib.h> +#include <string.h> + +char * +_DEFUN (strndup, (str, n), + _CONST char *str _AND + size_t n) +{ + return _strndup_r (_REENT, str, n); +} + +#endif /* !_REENT_ONLY */ |