ustrzncat(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ ustrzncat ✨

okay bestie, we're in the Allegro manual today and this one is literally the size-aware glow-up of string concatenation πŸ’… it lives in the Allegro game programming library, so if you're out here writing games, pull up a chair πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro.h>

char *ustrzncat(char *dest, int size, const char *src, int n);

πŸ’– DESCRIPTION πŸ’–

so here's the vibe: ustrzncat() is basically ustrzcat()'s slightly more careful cousin 🫢 the one difference β€” and it's a big one β€” is that it only ever appends no more than n characters from src onto the end of dest. like, it's got a hard limit and it respects it, periodt πŸ‘‘

and the way it handles the null? iconic. if the terminating null character in src gets reached before n characters have been written, then that null character is copied over β€” but no other characters get written after it. that's it, that's the whole rule ✨

also, and this is the reassuring part: dest is guaranteed to be null-terminated. no cap. you can breathe πŸ’š

πŸ¦‹ RETURN VALUE πŸ¦‹

the return value is just the value of dest πŸ’« she gives you back your own pointer, bestie, that's the whole gift 🎁


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the tea β˜• this page came to you from the Allegro manual, version 4.4.3, and yeah it's a whole <rainbow>ustrzncat(3)</rainbow> situation 🌈 go forth and concatenate responsibly, mwah πŸ’‹πŸ§š

πŸ“¦ where this page comes from