]> gitweb.hhaalo.de Git - discspan.git/commitdiff
fix: line length 80 characters
authorBastian Dehn <hhaalo@arcor.de>
Sun, 24 Dec 2017 10:28:48 +0000 (11:28 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 24 Dec 2017 10:28:48 +0000 (11:28 +0100)
discspan.c

index f8bd8bb45348208a9db47815dc16901b1639a6da..f16cb3538e7e775335c71e5f8641d29c99ee5985 100644 (file)
@@ -34,8 +34,6 @@ void printHumanReadSize(const char *output, unsigned long long int splitgroesse)
                        splitgroesse, humanread, einheit);
 }
 
-
-
 int cmpfunc(const void *filea, const void *fileb)
 {
        long long unsigned int a = ((const struct file_size*)filea)->fsize;
@@ -115,7 +113,9 @@ void usage()
 int splitter(struct file_size *input, const char *output,
                unsigned long long splitgroesse, int length)
 {
-       struct file_size *rest = (struct file_size *)malloc(length * sizeof(struct file_size));
+       struct file_size *rest = (struct file_size *)
+               malloc(length * sizeof(struct file_size));
+
        unsigned long long filesize = 0;
        char *filename;
        int restcount = 0;
@@ -193,10 +193,15 @@ int main(int argc, char *argv[])
 
        // Liest die Quelldatei in den Ram
        FILE *in = fopen(input, "r");
+
        int s_length = get_array_length(in);
-       struct file_size *fs = (struct file_size *)malloc((s_length + 1) * sizeof(struct file_size));
+       struct file_size *fs = (struct file_size *)
+               malloc(s_length * sizeof(struct file_size));
+
        s_length = fill_array_from_file(in, fs, split);
-       fs = (struct file_size *)realloc(fs, s_length * sizeof(struct file_size));
+       fs = (struct file_size *)
+               realloc(fs, s_length * sizeof(struct file_size));
+
        fclose(in);
 
        // sortieren
@@ -207,7 +212,8 @@ int main(int argc, char *argv[])
        while(s_length > 0) {
                sprintf(outname, "%s%03d", output, num++);
                s_length = splitter(fs, outname, split, s_length);
-               fs = (struct file_size *)realloc(fs, s_length * sizeof(struct file_size));
+               fs = (struct file_size *)
+                       realloc(fs, s_length * sizeof(struct file_size));
        }
 
        free(fs);