SDL_strlcat(3)
π SDL_strlcat π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, this one's about SDL_strlcat and it's lowkey a glow-up over the chaotic string functions your ancestors used. pull up a chair π«Ά
β¨ NAME β¨
SDL_strlcat β concatenate strings, but the safe way, no cap π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
size_t SDL_strlcat(char *dst, const char *src, size_t maxlen);
π¦ DESCRIPTION π¦
so the vibe is: this function appends up to maxlen - SDL_strlen(dst) - 1 characters from src to the end of the string that's already chilling in dst, and then it appends a null terminator. that's it. that's the whole job. iconic. β¨
srcanddstmust not overlap. like, at all. they are not in a situationship, they need their own space π«
and if maxlen - SDL_strlen(dst) - 1 works out to less than or equal to 0? then dst stays completely unmodified. untouched. not a single character moved. it's giving "no thoughts, head empty" π
π FUNCTION PARAMETERS π
dstβ the destination buffer, and it already has to contain the first null-terminated string. must not beNULL, and must not overlap withsrc.srcβ the second null-terminated string. must not beNULL, and must not overlap withdst.maxlenβ the length (in characters) of the destination buffer. the whole buffer, bestie, not just the free space left in it π
π RETURN VALUE π
it returns the length (in characters, null terminator not included, she's not invited) of the string in dst plus the length of src. so basically the size of the combined vibe, in characters. π
π₯ THREAD SAFETY π₯
it is safe to call this function from any thread. go wild, queen, no locks required π
β AVAILABILITY β
this function is available since SDL 3.2.0. if your SDL is older than that, bestie, you're out of luck, go update π
π SEE ALSO π
and that's the tea, fr fr. go forth and concatenate responsibly π
this page came to you courtesy of Simple Directmedia Layer, version SDL 3.4.18 β mwah, take care of her π«Άβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms