Merge branch 'getuid-fix' into 'development'
https://stackoverflow.com/questions/14950378 See merge request damask/DAMASK!320
This commit is contained in:
commit
715504ee53
|
@ -43,7 +43,7 @@ void gethostname_c(char hostname[], int *stat){
|
||||||
|
|
||||||
|
|
||||||
void getusername_c(char username[], int *stat){
|
void getusername_c(char username[], int *stat){
|
||||||
struct passwd *pw = getpwuid(geteuid());
|
struct passwd *pw = getpwuid(getuid());
|
||||||
if(pw && strlen(pw->pw_name) <= STRLEN){
|
if(pw && strlen(pw->pw_name) <= STRLEN){
|
||||||
strncpy(username,pw->pw_name,STRLEN+1);
|
strncpy(username,pw->pw_name,STRLEN+1);
|
||||||
*stat = 0;
|
*stat = 0;
|
||||||
|
|
Loading…
Reference in New Issue