libc: simplify getuser
This commit is contained in:
parent
0c63c7dc91
commit
2dcdf47b04
|
@ -23,8 +23,7 @@ jehanne_getuser(void)
|
||||||
n = read(fd, user, (sizeof user)-1);
|
n = read(fd, user, (sizeof user)-1);
|
||||||
close(fd);
|
close(fd);
|
||||||
if(n <= 0)
|
if(n <= 0)
|
||||||
jehanne_strcpy(user, "none");
|
return "none";
|
||||||
else
|
user[n] = '\0';
|
||||||
user[n] = 0;
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue