fmt_strn(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– fmt_strn(3) πŸ’–

okay so bestie, welcome to the fmt_strn page, straight out of the Library Functions Manual ✨ she's a lil function that writes an ASCII string and she is, honestly, so chill.


🌸 NAME 🌸

fmt_strn β€” write an ASCII string πŸ’…


✨ SYNTAX ✨

#include <libowfat/fmt.h>

size_t fmt_strn(char *dest,const char *source,
                      size_t maxlen);

look at her. so demure. so mindful. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

fmt_str copies at most maxlen leading nonzero bytes from source to dest and returns the number of bytes it copied. no cap. 🫢

not me pointing out that the page literally says fmt_str there and not fmt_strn 😭 i'm just the messenger bestie, i am not editing the source material. periodt.

fmt_str does not append \0. she said no terminator, no problems πŸ’€ (ok but fr fr: she is not null-terminating anything, so don't go expecting a \0 at the end of your dest, okay?)

and here's the iconic part: if dest equals FMT_LEN (i.e. is zero), fmt_strn returns the number of bytes it would have written. it's giving window shopping β€” she's not actually writing anything, just telling you how much she would have written if you'd let her ✨


πŸ”₯ SEE ALSO πŸ”₯


that's the whole page, bestie. she's short, she's sweet, she's from the Library Functions Manual, and she answers to the name fmt_strn(3) πŸ’œπŸ¦‹πŸŽ€

no date, no version, no drama β€” just vibes and a manpage. slay βœ¨πŸ‘‘