Fix printing of invalid d_type in getdents syscall

* dirent.c (SYS_FUNC(getdents)): Treat d_type as unsigned char to avoid
potential sign-extension bug when printing invalid d_type.
This commit is contained in:
Дмитрий Левин 2016-05-16 21:35:07 +00:00
parent 2eb56d1906
commit 7fb984e27e

View File

@ -76,7 +76,7 @@ SYS_FUNC(readdir)
SYS_FUNC(getdents)
{
unsigned int i, len, dents = 0;
char *buf;
unsigned char *buf;
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);