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.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c
index e687ff3546..b6c013fa59 100644
--- a/src/nvim/os/users.c
+++ b/src/nvim/os/users.c
@@ -21,16 +21,13 @@ int os_get_usernames(garray_T *users)
ga_init(users, sizeof(char *), 20);
# if defined(HAVE_GETPWENT) && defined(HAVE_PWD_H)
- char *user;
struct passwd *pw;
setpwent();
while ((pw = getpwent()) != NULL) {
// pw->pw_name shouldn't be NULL but just in case...
if (pw->pw_name != NULL) {
- ga_grow(users, 1);
- user = xstrdup(pw->pw_name);
- ((char **)(users->ga_data))[users->ga_len++] = user;
+ GA_APPEND(char *, users, xstrdup(pw->pw_name));
}
}
endpwent();