strnlen
strnlen is a function in C programming that calculates the length of a string, but with a limit on the number of characters to check. It is defined in the string.h header file. The function takes two arguments: a pointer to the null-terminated string and an unsigned integer representing the maximum number of characters to count.
Unlike the standard strlen function, which continues counting characters until it encounters the null terminator ('\0'),
The return value of strnlen is the number of characters counted, up to the specified maximum length.