fmt_strm_malloc(3)

πŸ’– fmt_strm_malloc β€” bestie edition πŸ’–

okay so this is a page from the Library Functions Manual about fmt_strm_malloc, and honestly? she's a lil workhorse and we're gonna give her main character energy. let's go 🫢


✨ NAME ✨

fmt_strm_malloc β€” write multiple ASCII strings, all at once, no cap 🌈


✨ SYNTAX ✨

#include <stdlib.h> #include <libowfat/fmt.h>

char* fmt_strm_malloc(const char *source, ...);

yes bestie, that's a variadic function, she takes as many string args as your heart desires πŸ’…


✨ DESCRIPTION ✨

fmt_strm_malloc takes source and all the following function arguments, copies all leading nonzero bytes from them into a freshly allocated heap buffer, and hands you back a pointer to that buffer. it's giving "here's your string, babe, made it fresh just for you" πŸŽ€

the buffer was allocated with malloc, so you need to call free on it when you're done. like, for real for real. don't leave her hanging, that's a memory leak and we don't do those in this house πŸ’€

unlike fmt_strm, fmt_strm_malloc does append \0. so she's actually null-terminated. iconic behaviour honestly ⭐


✨ SEE ALSO ✨

go read those too, they're all part of the same lil friend group πŸ¦‹


and that's the whole page!! this footer is just fmt_strm_malloc(3) all over again, from the Library Functions Manual β€” no date or version drama to report, she's timeless πŸ’œ mwah, go call free on your buffer, ily, bye!! πŸ‘‘πŸŒΈ