ctype/iscntrl: correct the control character function
all the characters placed before the space on the ASCII table and the 0x7F character (DEL) are control characters. Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
89406462cc
commit
c8784faf3c
@ -143,7 +143,7 @@ int isgraph(int c);
|
||||
#ifdef __cplusplus
|
||||
static inline int iscntrl(int c)
|
||||
{
|
||||
return !isprint(c);
|
||||
return c < 0x20 || c == 0x7f;
|
||||
}
|
||||
#else
|
||||
int iscntrl(int c);
|
||||
|
@ -30,5 +30,5 @@
|
||||
|
||||
int iscntrl(int c)
|
||||
{
|
||||
return !isprint(c);
|
||||
return c < 0x20 || c == 0x7f;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user