1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

the system call write consider the parameter length

This commit is contained in:
Stefan Lankes 2015-07-11 15:20:19 +02:00
parent 2ce695750a
commit 6926ccc644

View file

@ -34,12 +34,15 @@
static int sys_write(int fd, const char* buf, size_t len)
{
size_t i;
//TODO: Currently, we ignore the file descriptor
if (BUILTIN_EXPECT(!buf, 0))
return -1;
kputs(buf);
for(i=0; i<len; i++)
kputchar(buf[i]);
return 0;
}