| 1 |
'\" t |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 5 |
.\" |
| 6 |
.TH strnul 3 2026-02-25 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
strnul \- string search NUL |
| 9 |
.SH LIBRARY |
| 10 |
gnulib \- The GNU Portability Library |
| 11 |
.SH SYNOPSIS |
| 12 |
.nf |
| 13 |
.B #include <string.h> |
| 14 |
.P |
| 15 |
.BI char\~*strnul(char\~* s ); |
| 16 |
.BI const\~char\~*strnul(const\~char\~* s ); |
| 17 |
.fi |
| 18 |
.SH DESCRIPTION |
| 19 |
.BR strnul () |
| 20 |
calculates the position of the terminating null byte (\[aq]\[rs]0\[aq]) |
| 21 |
in the string pointed to by |
| 22 |
.IR s . |
| 23 |
.P |
| 24 |
It is equivalent to both of the following expressions: |
| 25 |
.P |
| 26 |
.in +4n |
| 27 |
.EX |
| 28 |
s + strlen(s) |
| 29 |
strchr(s, \[aq]\[rs]0\[aq]) |
| 30 |
.EE |
| 31 |
.in |
| 32 |
.SH RETURN VALUE |
| 33 |
.BR strnul () |
| 34 |
returns a pointer to the terminating null byte |
| 35 |
in the string pointed to by |
| 36 |
.IR s . |
| 37 |
.SH ATTRIBUTES |
| 38 |
For an explanation of the terms used in this section, see |
| 39 |
.BR attributes (7). |
| 40 |
.TS |
| 41 |
allbox; |
| 42 |
lbx lb lb |
| 43 |
l l l. |
| 44 |
Interface Attribute Value |
| 45 |
T{ |
| 46 |
.na |
| 47 |
.nh |
| 48 |
.BR strnul () |
| 49 |
T} Thread safety MT-Safe |
| 50 |
.TE |
| 51 |
.SH STANDARDS |
| 52 |
GNU. |
| 53 |
.SH HISTORY |
| 54 |
gnulib 202607. |
| 55 |
.SH SEE ALSO |
| 56 |
.BR strlen (3), |
| 57 |
.BR strchr (3), |
| 58 |
.BR string (3) |