Browse Source

Ajout verification

Loquicom 6 years ago
parent
commit
2754390eef
1 changed files with 6 additions and 0 deletions
  1. 6 0
      myls.c

+ 6 - 0
myls.c

@@ -94,7 +94,13 @@ void printls(char* path, char* filename){
 
         //Recup le groupe et l'utilisateur
         grp = getgrgid(info.st_gid);
+        if(grp == NULL){
+            return;
+        }
         user = getpwuid(info.st_uid);
+        if(user == NULL){
+            return;
+        }
 
         //Recup la date
         memset(mois, 0, 5);