strnul(3)

πŸ“¦
version 6.20 Β· 3 versions
, in arch rolling, nixpkgs unstable

✨ strnul(3) ✨

okay bestie, welcome to strnul(3) β€” the lil function that finds the end of your string πŸ’–

🌸 NAME 🌸

strnul β€” string search NUL πŸŽ€


πŸ“š LIBRARY πŸ“š

gnulib β€” The GNU Portability Library 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <string.h>

char *strnul(char *s);
const char *strnul(const char *s);

πŸ’… DESCRIPTION πŸ’…

so strnul() figures out where the terminating null byte ('\0') lives inside the string that s points at. that's it. that's the whole job πŸ‘‘

it's literally equivalent to both of these expressions, no cap:

s + strlen(s)
strchr(s, '\0')

like, either one. same energy. same result. periodt ✨


πŸŽ€ RETURN VALUE πŸŽ€

strnul() hands you back a pointer to that terminating null byte in the string s points to. so you get a pointer to the '\0', not the string itself. she's pointing at the finish line 🏁


πŸ”₯ ATTRIBUTES πŸ”₯

(nvm if the terms here are confusing, attributes(7) has the whole explanation πŸ’œ)

  • Interface: strnul()
    • Attribute: Thread safety
    • Value: MT-Safe βœ…

MT-Safe means you can run her from multiple threads and she will Not cause drama 🫢


⭐ STANDARDS ⭐

GNU.


🌈 HISTORY 🌈

gnulib 202607. β€” yeah she's recent, she's new on the scene, and she's already iconic πŸ’…


πŸ‘€ SEE ALSO πŸ‘€


ok so tl;dr: strnul() = "where's the \0? here." and honestly? we love a function with zero chaos. go forth and find your null bytes bestie πŸ¦‹βœ¨

shoutout to the Linux man-pages 6.20 girlies, this page was dated 2026-02-25 πŸ’– that's the page for strnul(3), mwah, bye πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms