Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions shared/libc/string0.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <stdint.h>
#include <stddef.h>
#undef _FORTIFY_SOURCE
#include <string.h>

#include "py/mpconfig.h"
Expand Down Expand Up @@ -75,15 +76,6 @@ void *memcpy(void *dst, const void *src, size_t n) {
return dst;
}

// CIRCUITPY-CHANGE: extern
extern void *__memcpy_chk(void *dest, const void *src, size_t len, size_t slen);
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
Expand Down