range_str4inbuf(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

πŸ’– range_str4inbuf(3) β€” Library Functions Manual πŸ’–

okay bestie, this page is from the Library Functions Manual, and it's all about range_str4inbuf β€” the range check for a string in a buffer. it's giving "stay inside the lines" energy, fr fr.


✨ NAME ✨

range_str4inbuf β€” range check for string in buffer

πŸ¦‹ SYNTAX πŸ¦‹

#include <libowfat/rangecheck.h>

int range_str4inbuf(const void* buf,size_t len,const void* string);

🌸 DESCRIPTION 🌸

range_str4inbuf checks that the zero terminated UTF-32-string starting at string starts and ends within the buffer buf[0..len-1].

If the string is not 0-terminated but the length is known beforehand, use range_arrayinbuf instead.

πŸ’… RETURN VALUE πŸ’…

If the buffer is implausible (buf is NULL or buf+len has an integer overflow), return 0.

If string points before or after the buffer, return 0.

If there is no zero terminator within the buffer, return 0.

Otherwise, return 1.

πŸ‘€ SEE ALSO πŸ‘€

rangecheck(3)


and that's the whole vibe, bestie β€” range_str4inbuf(3), from the Library Functions Manual, signing off πŸ’–πŸ«Άβœ¨