Selaa lähdekoodia

Userland: Fix two compiler warnings.

Andreas Kling 6 vuotta sitten
vanhempi
commit
b0d1969ca5
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1 1
      Userland/chmod.cpp
  2. 1 1
      Userland/ls.cpp

+ 1 - 1
Userland/chmod.cpp

@@ -10,7 +10,7 @@ int main(int argc, char **argv)
         return 1;
         return 1;
     }
     }
 
 
-    mode_t mode;
+    unsigned mode;
     int rc = sscanf(argv[1], "%o", &mode);
     int rc = sscanf(argv[1], "%o", &mode);
     if (rc != 1) {
     if (rc != 1) {
         perror("sscanf");
         perror("sscanf");

+ 1 - 1
Userland/ls.cpp

@@ -111,7 +111,7 @@ int do_dir(const char* path)
         perror("opendir");
         perror("opendir");
         return 1;
         return 1;
     }
     }
-    char pathbuf[256];
+    char pathbuf[PATH_MAX];
 
 
     while (auto* de = readdir(dirp)) {
     while (auto* de = readdir(dirp)) {
         if (de->d_name[0] == '.' && !flag_show_dotfiles)
         if (de->d_name[0] == '.' && !flag_show_dotfiles)