summaryrefslogtreecommitdiff
path: root/shared/libc/string0.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared/libc/string0.c')
-rw-r--r--shared/libc/string0.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/shared/libc/string0.c b/shared/libc/string0.c
index 19ad14d0f..a3b268e44 100644
--- a/shared/libc/string0.c
+++ b/shared/libc/string0.c
@@ -25,7 +25,7 @@
*/
#include <stdint.h>
-#include <string.h>
+#include <stddef.h>
#define likely(x) __builtin_expect((x), 1)
@@ -64,6 +64,13 @@ void *memcpy(void *dst, const void *src, size_t n) {
return dst;
}
+void *__memcpy_chk(void *dest, const void *src, size_t len, size_t slen) {
+ if (len > slen) {
+ return NULL;
+ }
+ return memcpy(dest, src, len);
+}
+
void *memmove(void *dest, const void *src, size_t n) {
if (src < dest && (uint8_t*)dest < (const uint8_t*)src + n) {
// need to copy backwards