ustrzncat(3)
β¨ 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
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms