From 5ba10e3ee774602e20553091568551e210731fbb Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Sun, 8 Mar 2026 13:34:34 +0100 Subject: add strncpy helper Also fix a off by one bug in strnlen Signed-off-by: Carlos Maiolino --- src/include/toxic/string.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include') diff --git a/src/include/toxic/string.h b/src/include/toxic/string.h index b43942b..0aedb0b 100644 --- a/src/include/toxic/string.h +++ b/src/include/toxic/string.h @@ -10,6 +10,7 @@ bool isdigit(char c); size_t strlen(const char *s); size_t strnlen(const char *s, size_t maxlen); char *strcpy(char *restrict dst, const char *restrict src); +char *strncpy(char *restrict dst, const char *restrict src, size_t dsize); int strncmp(const char *s1, const char *s2, size_t n); void *memset(void *s, int c, size_t n); -- cgit v1.2.3