strlen(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– strlen(9) β€” Kernel API Manual πŸ’–

okay bestie, welcome to the strlen(9) page from the Kernel API Manual. it's short, it's iconic, and it has one huge safety warning. let's get into it 🫢

🌸 NAME 🌸

strlen β€” Return count of characters in a NUL-terminated string

✨ SYNOPSIS ✨

strlen (p );

πŸŽ€ ARGUMENTS πŸŽ€

  • p β€” pointer to NUL-terminated string to count.

πŸ¦‹ DESCRIPTION πŸ¦‹

🚨 Do not use this function unless the string length is known at compile-time. When p is unterminated, this function may crash or return unexpected counts that could lead to memory content exposures. Prefer strnlen.

Returns number of characters in p (NOT including the final NUL). periodt. πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

cross-refs, go look πŸ‘€:


mwah πŸ’‹ okay that's the whole page! source/version: ./include/linux; date: October 2026; and the page is strlen(9). bye bestie, stay NUL-terminated 🫢✨

πŸ“¦ where this page comes from