Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

strnlen - Determine length of a string up to a maximum length

&pagelevel(4)&pagelevel

Definition    

#include <string.h>

size_t strnlen(const char *s, size_t maxlen);

The strnlen function calculates the minimum of the two following values:

  • Number of bytes of the array to which s points, exclusively to the terminating NULL byte

  • Value of the maxlen parameter.

The strnlen function never checks more than maxlen bytes.

No errors are defined.

Return val.

Length of the string s or value of the maxlen parameter

when successful. The terminating null byte is not counted.