Fills a character string with a character, limiting length.
#include <extras/extras_string.h> char * strnset(char *str, int c, size_t max);
str
A pointer to a character string.
c
The character to fill with.
max
The maximum number of characters to fill.
This function stores c in the string pointed to by str. The function stops filling the string when it reaches a null character (which it leaves intact) or when it has filled max characters. The function always ensures that the character string is null-terminated.
The function returns str.
This facility is not specified in the ISO/IEC standards. It is an EWL extension of the standard libraries.