strnul(3)

strnul3

String search nul

Usage

#include <string.h>

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

Library

gnulib - The GNU Portability Library

Overview

strnul() calculates the position of the terminating null byte ('\0') in the string pointed to by s.

It is equivalent to both of the following expressions:

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

Return value

strnul() returns a pointer to the terminating null byte in the string pointed to by s.

Attributes

For an explanation of the terms used in this section, see attributes(7).

InterfaceAttributeValue
strnul()Thread safetyMT-Safe

Standards

GNU.

History

gnulib 202607.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.