Commit 56b81ea7 authored by Shinichiro Hamaji's avatar Shinichiro Hamaji

Style fixes for consistency

parent ebf81ac4
...@@ -306,21 +306,19 @@ static void MyUserNameInitializer() { ...@@ -306,21 +306,19 @@ static void MyUserNameInitializer() {
g_my_user_name = user; g_my_user_name = user;
} else { } else {
#if defined(HAVE_PWD_H) && defined(HAVE_UNISTD_H) #if defined(HAVE_PWD_H) && defined(HAVE_UNISTD_H)
uid_t uid;
struct passwd pwd; struct passwd pwd;
struct passwd*result = NULL; struct passwd* result = NULL;
char buffer[1024] = {'\0'}; char buffer[1024] = {'\0'};
uid = geteuid(); uid_t uid = geteuid();
int pwuid_res = getpwuid_r(uid, &pwd, buffer, sizeof (buffer), &result); int pwuid_res = getpwuid_r(uid, &pwd, buffer, sizeof(buffer), &result);
if(pwuid_res == 0) { if (pwuid_res == 0) {
g_my_user_name = pwd.pw_name; g_my_user_name = pwd.pw_name;
} } else {
else {
snprintf(buffer, sizeof(buffer), "uid%d", uid); snprintf(buffer, sizeof(buffer), "uid%d", uid);
g_my_user_name = buffer; g_my_user_name = buffer;
} }
#endif #endif
if(g_my_user_name.empty()) { if (g_my_user_name.empty()) {
g_my_user_name = "invalid-user"; g_my_user_name = "invalid-user";
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment