Fix all the missing comments.

This commit is contained in:
Enrico Fraccaroli
2022-01-03 22:25:21 +01:00
parent 181d1d69cb
commit 2461d82431
59 changed files with 826 additions and 601 deletions
+8 -8
View File
@@ -8,15 +8,15 @@
#include "string.h"
#include <stdio.h>
static void list_groups() {
group* iter;
static void list_groups()
{
group_t *iter;
while ((iter = getgrent()) != NULL) {
printf("Group\n\tname: %s\n\tpasswd: %s\n\tnames:\n",iter->gr_name, iter->gr_passwd);
printf("Group\n\tname: %s\n\tpasswd: %s\n\tnames:\n", iter->gr_name, iter->gr_passwd);
size_t count = 0;
while (iter->gr_mem[count] != NULL) {
printf("\t\t%s\n",iter->gr_mem[count]);
printf("\t\t%s\n", iter->gr_mem[count]);
count += 1;
}
@@ -24,8 +24,8 @@ static void list_groups() {
}
}
int main(int argc, char** argv) {
int main(int argc, char **argv)
{
printf("List of all groups:\n");
list_groups();
@@ -36,7 +36,7 @@ int main(int argc, char** argv) {
list_groups();
endgrent();
group* root_group = getgrgid(0);
group_t *root_group = getgrgid(0);
if (strcmp(root_group->gr_name, "root") != 0) {
printf("Error in getgrgid function.");
return 1;