summaryrefslogtreecommitdiff
path: root/src/string/strncat_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/strncat_s.c
parent7f9129145f2293cb8c9052ff1f395226421b0ae4 (diff)
update standard and safety checks
Diffstat (limited to 'src/string/strncat_s.c')
-rw-r--r--src/string/strncat_s.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/string/strncat_s.c b/src/string/strncat_s.c
index fa68151c..989ad763 100644
--- a/src/string/strncat_s.c
+++ b/src/string/strncat_s.c
@@ -1,14 +1,13 @@
-#if 0
-
#include <string.h>
+#include "_safety.h"
/** concatenate bounded string **/
errno_t strncat_s(char * restrict s1, rsize_t s1max, const char * restrict s2, rsize_t n)
{
- __C_EXT(1, 201112L);
- //__ASSERT_NONNULL(s1);
- //__ASSERT_NONNULL(s2);
- //__ASSERT_NOOVERLAP(s1, s2, strlen(s1) + strlen(s2));
+ SIGNAL_SAFE(0);
+ ASSERT_NONNULL(s1);
+ ASSERT_NONNULL(s2);
+ (void)s1max; //ASSERT_NOOVERLAP(s1, s1max, s2, strlen(s1) + strlen(s2));
char *append = s1 + strlen(s1);
for (size_t i = 0; i < n; i++) {
@@ -23,7 +22,7 @@ errno_t strncat_s(char * restrict s1, rsize_t s1max, const char * restrict s2, r
*append = '\0';
}
- return s1;
+ return 0;
}
/***
@@ -44,6 +43,3 @@ terminated.
/*
CEXT1(201112)
*/
-
-
-#endif