commit 98871ab9a52db7d31579d8b1352563b3da837d78
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Tue Feb 21 08:16:19 2017 +0100
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Tue Feb 21 08:16:45 2017 +0100

    [libc] Add supports for strxfrm()

diff --git a/libc/src/Makefile b/libc/src/Makefile
index 555d4cb..022e6ff 100644
--- a/libc/src/Makefile
+++ b/libc/src/Makefile
@@ -3,6 +3,7 @@
 
 LIBCOBJ = assert.o strcpy.o strcmp.o strlen.o strchr.o \
           strrchr.o strcat.o strncpy.o strncat.o strcoll.o \
+          strxfrm.o \
           memset.o memcpy.o memmove.o memcmp.o memchr.o \
           isalnum.o isalpha.o isascii.o isblank.o iscntrl.o isdigit.o \
           isgraph.o islower.o isprint.o ispunct.o isspace.o isupper.o \
diff --git a/libc/src/strxfrm.c b/libc/src/strxfrm.c
new file mode 100644
index 0000000..8ea0140
--- /dev/null
+++ b/libc/src/strxfrm.c
@@ -0,0 +1,13 @@
+/* See LICENSE file for copyright and license details. */
+
+#include <string.h>
+
+size_t
+strxfrm(char *dst, const char *src, size_t n)
+{
+       size_t len = strlen(src);
+
+       if (len < n)
+               strcpy(dst, src);
+       return len;
+}

Reply via email to