Replace strcat with strlcat
This commit is contained in:
16
src/util/strlcat.h
Normal file
16
src/util/strlcat.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef STRLCAT_H
|
||||
#define STRLCAT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* Appends src to string dst of size siz (unlike strncat, siz is the
|
||||
* full size of dst, not space left). At most siz-1 characters
|
||||
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
|
||||
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
|
||||
* If retval >= siz, truncation occurred.
|
||||
*/
|
||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user