diff options
| author | Carlos Maiolino <[email protected]> | 2026-03-08 13:34:34 +0100 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2026-03-08 13:47:28 +0100 |
| commit | 5ba10e3ee774602e20553091568551e210731fbb (patch) | |
| tree | 09250320a20ce832b7e6b831270503fb3c099f13 /src/include/toxic | |
| parent | 525d3163a541c3553d88acc5cc2db4cc58b5b42d (diff) | |
add strncpy helper
Also fix a off by one bug in strnlen
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'src/include/toxic')
| -rw-r--r-- | src/include/toxic/string.h | 1 |
1 files changed, 1 insertions, 0 deletions
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); |
