diff options
Diffstat (limited to 'src/string/memmove_s.c')
-rw-r--r-- | src/string/memmove_s.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/string/memmove_s.c b/src/string/memmove_s.c index 69bc7208..53e81b45 100644 --- a/src/string/memmove_s.c +++ b/src/string/memmove_s.c @@ -5,15 +5,14 @@ /** move memory **/ errno_t memmove_s(void *s1, rsize_t s1max, const void *s2, rsize_t n) { - __C_EXT(1, 201112L); __ASSERT_NONNULL(s1); __ASSERT_NONNULL(s2); - void *buf = malloc(n); - memcpy(buf, s2, n); - memcpy(s1, buf, n); - free(buf); - return s1; + if (n > s1max) { + /* do the right thing */ + } + + return memmove(s1, s2, n); } /*** |