fmt_ulong0(3)
β¨ fmt_ulong0(3) β¨ β the libowfat glow-up π
okay bestie, gather round, because today we're talking about fmt_ulong0, a little function from the Library Functions Manual corner of libowfat and honestly? she's giving zero-padded unsigned long realness and I'm obsessed π
πΈ NAME πΈ
fmt_ulong0 β write a zero-padded ASCII representation of an unsigned long integer π
π¦ SYNTAX π¦
like, here's how you pull up on her:
#include <libowfat/fmt.h>
size_t fmt_ulong0(char *dest, unsigned long source,
size_t n);
β¨ DESCRIPTION β¨
so fmt_ulong0 writes an ASCII representation (that's '0' through '9', base 10, no cap) of source into dest, and then it hands you back the number of bytes it actually wrote. simple. iconic. π
the output gets padded with '0'-bytes until it covers at least n bytes. and the way that she will not truncate if it doesn't fit?? she just lets it overflow, respectfully. no shrinking, no cutting corners, periodt.
π«Ά also she does not append \0. so don't be out here expecting a null terminator, bestie, that's not her job.
and if dest equals FMT_LEN (aka it's zero), then fmt_ulong0 just returns the number of bytes it would have written. it's like a lil preview, a vibe check before the main character moment π
for convenience β because libowfat loves us β fmt.h defines the integer FMT_ULONG to be big enough to hold every possible fmt_ulong output plus \0. so like, sized correctly, always π§
π SEE ALSO π
and that's the whole thing, bestie!! slay π this lil baddie is from the Library Functions Manual and the footer's giving fmt_ulong0(3) energy β same name, same date, same everything, fr fr. go forth and zero-pad responsibly β¨ππΈ
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms