---
name: "bson_strnlen"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_strnlen"
---

# bson\_strnlen(3)

## SYNOPSIS

```
size_t
bson_strnlen (const char *s, size_t maxlen);
```

## PARAMETERS

- •

  **s**: A string.

- •

  **maxlen**: The maximum size of string to check.

## DESCRIPTION

A portable version of **strnlen()**.

## RETURNS

The length of **s** in bytes or **maxlen** if no **\\0** was found.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
