From: Bastian Dehn Date: Sat, 23 Dec 2017 23:36:08 +0000 (+0100) Subject: change only filename overhead X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=d6ea69eb3e13a5cbc9840981ffbd0a86e47c6ab2;p=discspan.git change only filename overhead --- 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) {