]> gitweb.hhaalo.de Git - discspan.git/commitdiff
fix: code style
authorBastian Dehn <hhaalo@arcor.de>
Sun, 24 Dec 2017 09:30:44 +0000 (10:30 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 24 Dec 2017 09:30:44 +0000 (10:30 +0100)
discspan.c

index e01c2a9c537b7fffd93f23f95e064e2c1796deee..f8bd8bb45348208a9db47815dc16901b1639a6da 100644 (file)
@@ -78,9 +78,7 @@ unsigned long fill_array_from_file(FILE *in, struct file_size *fs,
                stat(pfad, &st);
 
                if(st.st_size <= split) {
-                       // kopiert den pfad String ins struct
                        strcpy(fs[lines].name, pfad);
-                       // Filesize in struct
                        fs[lines++].fsize = st.st_size;
                } else {
                        // irgnore List erstellen
@@ -92,7 +90,6 @@ unsigned long fill_array_from_file(FILE *in, struct file_size *fs,
        }
        lines--;
 
-
        if(ignore != NULL)
                fclose(ignore);
 
@@ -133,7 +130,7 @@ int splitter(struct file_size *input, const char *output,
                filename = strrchr(input[i].name, '/') + 1;
                filesize = 33 + strlen(filename) + input[i].fsize;
                filesize = ceil(filesize / 2048.0) * 2048;
-               // filesize inklusive overhead
+
                if(splitgroesse >= filesize) {
                        splitgroesse -= filesize;
                        fprintf(out, "%s\n", input[i].name);
@@ -141,14 +138,13 @@ int splitter(struct file_size *input, const char *output,
                        rest[restcount++] = input[i];
                }
        }
-       restcount--;
        fclose(out);
+       restcount--;
 
        printHumanReadSize(output, splitgroesse);
 
-       if(restcount > 0) {
+       if(restcount > 0)
                memcpy(input, rest, length * sizeof(struct file_size));
-       }
 
        free(rest);
        return restcount;