---
name: "strnul"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/strnul"
---

# strnul(3)

string search NUL

## 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

**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)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **strnul**() | Thread safety | MT-Safe |

## STANDARDS

GNU.

## HISTORY

gnulib 202607.

## SEE ALSO

[**strlen**(3)](/strlen/3.md), [**strchr**(3)](/strchr/3.md), [**string**(3)](/string/3.md)
