]> gitweb.hhaalo.de Git - discspan.git/commitdiff
fix: correct return array length
authorBastian Dehn <hhaalo@arcor.de>
Sat, 24 Jul 2021 19:48:48 +0000 (21:48 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 24 Jul 2021 19:48:48 +0000 (21:48 +0200)
readfile.c
splitter.c

index cef3df6dc49f43a5c82734737040275e619b0803..4b62097589edc6ceb027791d26dce29ac99ce9e8 100644 (file)
@@ -65,7 +65,6 @@ int fill_array_from_file(FILE *in, file_size_t *fs,
        if (ignore != NULL)
                fclose(ignore);
 
-       lines--;
        return lines;
 }
 
index 19f3c509429f2befcc9cb7f435cfdcc1c384cfab..a3b07576be5d7c579a102e0187c16ab38a7e52aa 100644 (file)
@@ -10,7 +10,7 @@ void writeOutputFile(const char *outputPath, file_size_t *disc, int length)
 {
        FILE *out = fopen(outputPath, "w");
 
-       for (int i = 0; i <= length; i++) {
+       for (int i = 0; i < length; i++) {
                fprintf(out, "%s\n", disc[i].name);
        }
 
@@ -61,6 +61,5 @@ int splitter(file_size_t *input, const char *output,
 
        free(rest);
        free(disc);
-       restcount--;
        return restcount;
 }