range_str2inbuf(3)
π NAME π
okay so bestie, this is range_str2inbuf β she does a range check for a string in a buffer. no cap. β¨
β¨ SYNTAX β¨
#include <libowfat/rangecheck.h>
int range_str2inbuf(const void* buf,size_t len,const void* string);
π¦ DESCRIPTION π¦
range_str2inbuf checks that the zero terminated UTF-16-string starting at string starts and ends within the buffer buf[0..len-1]. she's basically making sure your string is not out here wandering into the void, periodt. π
If the string is not 0-terminated but the length is known beforehand, use range_arrayinbuf instead. that's the sister function for when you already know how long it is, iykyk. π«Ά
πΈ RETURN VALUE πΈ
- If the buffer is implausible (
bufisNULLorbuf+lenhas an integer overflow), return0. that's a hard no. π - If
stringpoints before or after the buffer, return0. she's outside the function's assigned area, not invited. π - If there is no zero terminator within the buffer, return
0. no end in sight? not today. π - Otherwise, return
1. slay! she passed the vibe check. π
π SEE ALSO π
this has been your girl range_str2inbuf(3) from the Library Functions Manual, no date given, just vibes and range checks. stay safe out there, bestie πβ¨π
π¦ 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