libc: Add definitions for strnlen, strndup and strlcpy to string.h
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-03-12 11:10:18 +01:00
parent 377b8bea43
commit 36e0a1e970
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -26,6 +26,9 @@ extern "C"
/* Return the length of a null-terminated string. */
size_t strlen(const char* str);
/* Return the length of a fixed-size null-terminated string. */
size_t strnlen(const char* str, size_t max);
/* Compare two null-terminated strings. */
int strcmp(const char* a, const char* b);
@ -56,6 +59,12 @@ extern "C"
/* Separate a string into several tokens. */
char* strtok(char* str, const char* delim);
/* Return a heap-allocated copy of a fixed-size string. */
char* strndup(const char* str, size_t max);
/* Copy up to max bytes of src into dest, adding a null terminator at the end. */
size_t strlcpy(char* dest, const char* src, size_t max);
#ifdef __cplusplus
}
#endif