ustrzcat(3alleg4)
π ustrzcat β it's a 3alleg4 girlie, Allegro manual energy π
okay so bestie, we're in the Allegro game programming library and this one is ustrzcat(3alleg4) β the string-gluing queen who also knows her own size. no cap.
β¨ SYNOPSIS β¨
#include <allegro.h>
char *ustrzcat(char *dest, int size, const char *src);
πΈ DESCRIPTION πΈ
so what she does is: she concatenates src onto the end of dest. but here's the twist that makes her iconic β the length of dest in bytes is specified by size, and she guarantees it's null-terminated, even when src is bigger than size. like, she ate and left no crumbs. π₯
β οΈ okay but listen, this is the part where you gotta pay attention: even for empty strings, your destination string needs at least enough bytes to hold the terminating null character of the string, and your size parameter has to reflect that. like fr fr.
and if you don't do that? the vibe check fails HARD:
- the debug version of Allegro will abort at an assertion π
- the release version of Allegro will overrun the destination buffer π
so like, please give her room to breathe. she's not asking for much, she's asking for a null terminator's worth of space. periodt.
π RETURN VALUE π
she hands you back the value of dest. that's it, that's the whole return. giving you back exactly what you gave her, plus a little extra string energy. π
π¦ SEE ALSO π¦
go read those too bestie, iykyk π«Ά
Allegro version 4.4.3 β mwah, that's the version and the vibe, from your fave ustrzcat(3alleg4) page. stay safe out there and always count your bytes. πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms