]> uap-core.de Git - uwplayer.git/commitdiff
fix arg stat check
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 7 Aug 2025 18:39:36 +0000 (20:39 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 7 Aug 2025 18:39:36 +0000 (20:39 +0200)
application/main.c

index 101bb72acda0bfcb17e2e624daa24bc16a3d5524..d49dc72a9a8cc3de1103b080f3d6c35e0b18c888 100644 (file)
@@ -107,13 +107,14 @@ int main(int argc, char** argv) {
     if(argc > 1) {
         open_file_arg = cxArrayListCreateSimple(CX_STORE_POINTERS, argc-1);
         for(int i=1;i<argc;i++) {
+            char *arg = argv[i];
             struct stat s;
-            if(stat(argv[1], &s)) {
+            if(stat(arg, &s)) {
                 fprintf(stderr, "Cannot open file: %s\n", argv[1]);
                 perror("");
                 return 1;
             }
-            cxListAdd(open_file_arg, argv[i]);
+            cxListAdd(open_file_arg, arg);
         }
     }