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/strncpy.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/string/strncpy.c') diff --git a/src/string/strncpy.c b/src/string/strncpy.c index 0bea303a..10786ebd 100644 --- a/src/string/strncpy.c +++ b/src/string/strncpy.c @@ -1,7 +1,6 @@ -#if 0 - #include -#include "_assert.h" +#include "_safety.h" +#undef strncpy /** copy bounded string **/ @@ -9,9 +8,10 @@ char * strncpy(char * restrict s1, const char * restrict s2, size_t n) { size_t i; + SIGNAL_SAFE(0); ASSERT_NONNULL(s1); ASSERT_NONNULL(s2); - ASSERT_NOOVERLAP(s1, s2, n); + ASSERT_NOOVERLAP(s1, n, s2, n); for (i = 0; i < n; i++) { s1[i] = s2[i]; @@ -36,6 +36,3 @@ terminated. RETURN_ALWAYS(ARGUMENT(s1)); STDC(1) */ - - -#endif -- cgit v1.2.1