From: Bastian Dehn Date: Sun, 24 Dec 2017 09:30:44 +0000 (+0100) Subject: fix: code style X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=05df9ef6bf0355b0692c92fd6255ab2c50231c78;p=discspan.git fix: code style --- diff --git a/discspan.c b/discspan.c index e01c2a9..f8bd8bb 100644 --- a/discspan.c +++ b/discspan.c @@ -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;