aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/users.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os/users.c')
-rw-r--r--src/nvim/os/users.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c
index 7c48ac6e5e..c6463c2c92 100644
--- a/src/nvim/os/users.c
+++ b/src/nvim/os/users.c
@@ -75,11 +75,10 @@ int os_get_uname(uv_uid_t uid, char *s, size_t len)
char *os_get_user_directory(const char *name)
{
#if defined(HAVE_GETPWNAM) && defined(HAVE_PWD_H)
- struct passwd *pw;
if (name == NULL || *name == NUL) {
return NULL;
}
- pw = getpwnam(name); // NOLINT(runtime/threadsafe_fn)
+ struct passwd *pw = getpwnam(name); // NOLINT(runtime/threadsafe_fn)
if (pw != NULL) {
// save the string from the static passwd entry into malloced memory
return xstrdup(pw->pw_dir);