range_validbuf(3)
π range_validbuf(3) π
okay bestie, welcome to the Library Functions Manual, section 3, where we check whether your buffer is even real or just delulu β¨
πΈ NAME πΈ
range_validbuf β range check buffer π«Ά
like, it vibe-checks a buffer. that's the whole job. she's simple, she's iconic, she's employed.
π SYNTAX π
#include <libowfat/rangecheck.h>
int range_validbuf(const void* buf,size_t len);
yes girl, include the header, call the function, live your truth π
π¦ DESCRIPTION π¦
range_validbuf does some basic plausibility checks on the buffer buf[0..len-1].
that's it. that's the function. she's not doing a full audit, she's not reading your code's diary, she's just asking "does this buffer pass the vibe check" and honestly? we love a low-effort queen π
β RETURN VALUE β
- If the buffer is implausible β meaning
bufisNULLorbuf+lenhas an integer overflow β it returns0. π - Otherwise, it returns
1. β¨
so like, 0 = "not me getting a NULL pointer bestie π", 1 = "she's valid, periodt π"
ngl the overflow check is the main character here β ifbuf+lenwraps around, that math is lying to you andrange_validbufis NOT falling for it π
π SEE ALSO π
go read her sister, she's also serving π
that's the whole page bestie!! πΈ written under the Library Functions Manual banner (section 3, where all the good library functions live), and the footer? it just says range_validbuf(3) with no date on it, so no birthday party for this one πβ¨ anyway ily, go check your buffers, stay safe, mwah π
π
π¦ 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