libc: Add definitions for strnlen, strndup and strlcpy to string.h
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
377b8bea43
commit
36e0a1e970
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user