Return the length of string, capped at maximumLength.
Synopsis
Declared in <bdlb_string.h>
static
int
strnlen(
char const* string,
int maximumLength);
Description
Return the minimum of the length of the specified string and the specified maximumLength. If maximumLength is 0, string may be null and 0 is returned. The behavior is undefined unless 0 <= maximumLength.
Return Value
min(strlen(string), maximumLength)
Parameters
Name |
Description |
string |
null‐terminated string to measure |
maximumLength |
upper bound on the returned length |
Created with MrDocs