mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2024-11-11 13:50:52 -05:00
getpwuid call moved
This commit is contained in:
parent
6ffe86ca12
commit
665ce3e215
1 changed files with 2 additions and 2 deletions
4
i3lock.c
4
i3lock.c
|
@ -661,7 +661,7 @@ static void raise_loop(xcb_window_t window) {
|
|||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
struct passwd *pw;
|
||||
char *username;
|
||||
char *image_path = NULL;
|
||||
int ret;
|
||||
|
@ -687,7 +687,7 @@ int main(int argc, char *argv[]) {
|
|||
{NULL, no_argument, NULL, 0}
|
||||
};
|
||||
|
||||
if (pw == NULL)
|
||||
if ((pw = getpwuid(getuid())) == NULL)
|
||||
err(EXIT_FAILURE, "getpwuid() failed");
|
||||
if ((username = pw->pw_name) == NULL)
|
||||
errx(EXIT_FAILURE, "pw->pw_name is NULL.\n");
|
||||
|
|
Loading…
Reference in a new issue