From d6ea69eb3e13a5cbc9840981ffbd0a86e47c6ab2 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 24 Dec 2017 00:36:08 +0100 Subject: [PATCH] change only filename overhead --- discspan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discspan.c b/discspan.c index 2e8ef79..93937bd 100644 --- a/discspan.c +++ b/discspan.c @@ -121,6 +121,7 @@ int splitter(struct file_size *input, const char *output, { struct file_size *rest = (struct file_size *)malloc(length * sizeof(struct file_size)); unsigned long long filesize = 0; + char *filename; int restcount = 0; FILE *out; @@ -130,7 +131,8 @@ int splitter(struct file_size *input, const char *output, out = fopen(output, "w"); for(int i = 0; i <= length; i++) { // ISO9660 filesystem overhead - filesize = 33 + strlen(input[i].name) + input[i].fsize; + 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) { -- 2.39.5