libc: simplify getuser

This commit is contained in:
Giacomo Tesio 2017-10-31 00:08:37 +01:00
parent 0c63c7dc91
commit 2dcdf47b04
1 changed files with 2 additions and 3 deletions

View File

@ -23,8 +23,7 @@ jehanne_getuser(void)
n = read(fd, user, (sizeof user)-1);
close(fd);
if(n <= 0)
jehanne_strcpy(user, "none");
else
user[n] = 0;
return "none";
user[n] = '\0';
return user;
}