'\" t .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .TH strnul 3 2026-02-25 "Linux man-pages 6.18" .SH NAME strnul \- string search NUL .SH LIBRARY gnulib \- The GNU Portability Library .SH SYNOPSIS .nf .B #include .P .BI char\~*strnul(char\~* s ); .BI const\~char\~*strnul(const\~char\~* s ); .fi .SH DESCRIPTION .BR strnul () calculates the position of the terminating null byte (\[aq]\[rs]0\[aq]) in the string pointed to by .IR s . .P It is equivalent to both of the following expressions: .P .in +4n .EX s + strlen(s) strchr(s, \[aq]\[rs]0\[aq]) .EE .in .SH RETURN VALUE .BR strnul () returns a pointer to the terminating null byte in the string pointed to by .IR s . .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). .TS allbox; lbx lb lb l l l. Interface Attribute Value T{ .na .nh .BR strnul () T} Thread safety MT-Safe .TE .SH STANDARDS GNU. .SH HISTORY gnulib 202607. .SH SEE ALSO .BR strlen (3), .BR strchr (3), .BR string (3)