summaryrefslogtreecommitdiff
path: root/src/string/memcpy_s.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-01-30 15:29:55 -0500
committerJakob Kaivo <jkk@ung.org>2024-01-30 15:29:55 -0500
commit9b6f6642ee252a9bedbe267fd85376fc9359c74f (patch)
tree5676ac47d416ef56b8134d94df49110abc53998f /src/string/memcpy_s.c
parent7f9129145f2293cb8c9052ff1f395226421b0ae4 (diff)
update standard and safety checks
Diffstat (limited to 'src/string/memcpy_s.c')
-rw-r--r--src/string/memcpy_s.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/string/memcpy_s.c b/src/string/memcpy_s.c
index 2d30921b..07211c4c 100644
--- a/src/string/memcpy_s.c
+++ b/src/string/memcpy_s.c
@@ -1,23 +1,21 @@
-#if 0
-
#include <string.h>
-#include "_assert.h"
+#include "_safety.h"
/** copy memory **/
errno_t memcpy_s(void * restrict s1, rsize_t s1max, const void * restrict s2, rsize_t n)
{
- __C_EXT(1, 201112L);
- __ASSERT_NONNULL(s1);
- __ASSERT_NONNULL(s2);
- __ASSERT_NOOVERLAP(s1, s2, n);
+ SIGNAL_SAFE(0);
+ ASSERT_NONNULL(s1);
+ ASSERT_NONNULL(s2);
+ ASSERT_NOOVERLAP(s1, s1max, s2, n);
char *dst = (char*)s1, *src = (char*)s2;
- int i = 0;
+ rsize_t i = 0;
while (i < n) {
dst[i] = src[i];
i++;
}
- return dst;
+ return 0;
}
/***
@@ -35,6 +33,3 @@ arg(s1).
/*
CEXT1(201112)
*/
-
-
-#endif