libc: minimal: Add an implementation of iscntrl()
Implement the iscntrl() function, which returns whether a character is a control one or not. Ref: https://en.cppreference.com/w/c/string/byte/iscntrl Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
69311ccc3d
commit
38f6fd05bf
|
@ -69,6 +69,11 @@ static inline int isalnum(int chr)
|
|||
return (int)(isalpha(chr) || isdigit(chr));
|
||||
}
|
||||
|
||||
static inline int iscntrl(int c)
|
||||
{
|
||||
return (int)((((unsigned int)c) <= 31U) || (((unsigned int)c) == 127U));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue