]> gitweb.hhaalo.de Git - discspan.git/commitdiff
remove: overhead berechnung
authorBastian Dehn <hhaalo@arcor.de>
Sat, 23 Dec 2017 20:18:52 +0000 (21:18 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 23 Dec 2017 20:18:52 +0000 (21:18 +0100)
discspan.c

index 5c18512d37379939038be6b402103a86d7655582..f3e523906edbf72a3bf6e1697a6525aa49a9fbc0 100644 (file)
@@ -119,17 +119,14 @@ int splitter(struct file_size *input, const char *output,
 {
        struct file_size *rest = (struct file_size *)malloc(length * sizeof(struct file_size));
        int restcount = 0;
-       unsigned long long int filesize;
        FILE *out;
 
        out = fopen(output, "w");
        for(int i = 0; i <= length; i++) {
                // filesize inklusive overhead
-               filesize = 33 + strlen(input[i].name) + input[i].fsize;
-
-               if(splitgroesse >= filesize) {
+               if(splitgroesse >= input[i].fsize) {
                        if(i < length) {
-                               splitgroesse -= filesize;
+                               splitgroesse -= input[i].fsize;
                                fprintf(out, "%s\n", input[i].name);
                        } else {
                                fprintf(out, "%s", input[i].name);