summaryrefslogtreecommitdiffstats
path: root/pwcache.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-04-04 09:33:21 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-04-16 12:09:16 -0400
commit8f5a73a6585bd425807430fd80ce1e3a737f4c5f (patch)
treefde0928db3d0f30b2d156ded10383eee2a9b3b91 /pwcache.c
parent7241d6cc35134fcb5ec6dfa81bbd01e430b2415f (diff)
downloadbfs-8f5a73a6585bd425807430fd80ce1e3a737f4c5f.tar.xz
style: Use &array[i] rather than array + i
Diffstat (limited to 'pwcache.c')
-rw-r--r--pwcache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pwcache.c b/pwcache.c
index 7812b50..91435bd 100644
--- a/pwcache.c
+++ b/pwcache.c
@@ -77,7 +77,7 @@ struct bfs_users *bfs_users_parse(void) {
endpwent();
for (size_t i = 0; i < darray_length(users->entries); ++i) {
- struct passwd *entry = users->entries + i;
+ struct passwd *entry = &users->entries[i];
struct trie_leaf *leaf = trie_insert_str(&users->by_name, entry->pw_name);
if (leaf) {
if (!leaf->value) {
@@ -133,7 +133,7 @@ void bfs_users_free(struct bfs_users *users) {
trie_destroy(&users->by_name);
for (size_t i = 0; i < darray_length(users->entries); ++i) {
- struct passwd *entry = users->entries + i;
+ struct passwd *entry = &users->entries[i];
free(entry->pw_shell);
free(entry->pw_dir);
free(entry->pw_name);
@@ -223,7 +223,7 @@ struct bfs_groups *bfs_groups_parse(void) {
endgrent();
for (size_t i = 0; i < darray_length(groups->entries); ++i) {
- struct group *entry = groups->entries + i;
+ struct group *entry = &groups->entries[i];
struct trie_leaf *leaf = trie_insert_str(&groups->by_name, entry->gr_name);
if (leaf) {
if (!leaf->value) {
@@ -279,7 +279,7 @@ void bfs_groups_free(struct bfs_groups *groups) {
trie_destroy(&groups->by_name);
for (size_t i = 0; i < darray_length(groups->entries); ++i) {
- struct group *entry = groups->entries + i;
+ struct group *entry = &groups->entries[i];
for (size_t j = 0; j < darray_length(entry->gr_mem); ++j) {
free(entry->gr_mem[j]);
}