SDL_strlcpy - Copy a string.
Contents
Availability
This function is available since SDL 3.2.0.
Description
This function copies up to maxlen - 1 characters from src to dst, then appends a null terminator.
If maxlen is 0, no characters are copied and no null terminator is written.
If you want to copy an UTF-8 string but need to ensure that multi-byte sequences are not truncated,
consider using SDL_utf8strlcpy().
Function Parameters
dst The destination buffer. Must not be NULL, and must not overlap with src.
src The null-terminated string to copy. Must not be NULL, and must not overlap with dst.
maxlen The length (in characters) of the destination buffer.
Name
SDL_strlcpy - Copy a string.
Return Value
Returns the length (in characters, excluding the null terminator) of src.
See Also
SDL_strlcat(3), SDL_utf8strlcpy(3) Simple Directmedia Layer SDL 3.2.20 SDL_strlcpy(3)
Synopsis
#include<SDL3/SDL_stdinc.h>size_tSDL_strlcpy(char*dst,constchar*src,size_tmaxlen);
Thread Safety
It is safe to call this function from any thread.
