From 9b6f6642ee252a9bedbe267fd85376fc9359c74f Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 30 Jan 2024 15:29:55 -0500 Subject: update standard and safety checks --- src/string/strcpy_s.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/string/strcpy_s.c') diff --git a/src/string/strcpy_s.c b/src/string/strcpy_s.c index bfad3189..4fdcc2d4 100644 --- a/src/string/strcpy_s.c +++ b/src/string/strcpy_s.c @@ -1,17 +1,17 @@ -#if 0 - #include #include +#include "_safety.h" /** copy string **/ errno_t strcpy_s(char * restrict s1, rsize_t s1max, const char * restrict s2) { - __C_EXT(1, 201112L); - __ASSERT_NONNULL(s1); - __ASSERT_NONNULL(s2); - __ASSERT_NOOVERLAP(s1, s2, strlen(s2)); + SIGNAL_SAFE(0); + ASSERT_NONNULL(s1); + ASSERT_NONNULL(s2); + ASSERT_NOOVERLAP(s1, s1max, s2, strlen(s2)); - return strncpy(s1, s2, strlen(s2)); + strncpy(s1, s2, strlen(s2)); + return 0; } /*** @@ -29,6 +29,3 @@ including the terminating char(\0). /* CEXT1(201112) */ - - -#endif -- cgit v1.2.1