bson_string_truncate(3)

bson_string_truncate3

Usage

void
bson_string_truncate (bson_string_t *string, uint32_t len);

WARNING:

Deprecated since version 1.29.0.

Parameters

•

string: A bson_string_t.

•

len: The new length of the string, excluding the trailing \0.

Overview

Truncates the string so that it is len bytes in length. This must be smaller or equal to the current length of the string.

A \0 byte will be placed where the end of the string occurs.

WARNING:

This function is oblivious to UTF-8 structure. If truncation occurs in the middle of a UTF-8 byte sequence, the resulting bson_string_t will contain invalid UTF-8.

WARNING:

The length of the resulting string (including the NULL terminator) MUST NOT exceed UINT32_MAX.

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Author

MongoDB, Inc

From libbson-doc 1.30.4-1+deb13u3 in Debian 13 (Trixie). Parsed by carta from the page's man source.