basic/user-util: modernize getgroups_alloc() a bit

- Make sure ret is initialized if we return >= 0
- Reduce variable scope
This commit is contained in:
Mike Yuan
2024-12-10 20:51:14 +01:00
parent 8112df6bef
commit f0e8db76ca
3 changed files with 20 additions and 23 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ int in_gid(gid_t gid);
int in_group(const char *name);
int merge_gid_lists(const gid_t *list1, size_t size1, const gid_t *list2, size_t size2, gid_t **result);
int getgroups_alloc(gid_t** gids);
int getgroups_alloc(gid_t **ret);
int get_home_dir(char **ret);
int get_shell(char **ret);