mmime: gen_build: don't crash on #-line without space

This commit is contained in:
Christian Neukirchen 2016-10-05 14:31:41 +02:00
parent e531f43ad6
commit 0b2e4880f5

18
mmime.c
View File

@ -301,14 +301,16 @@ gen_build()
if (!rflag && line[0] == '#') {
char *f = strchr(line, ' ');
*f = 0;
if (strchr(line, '/')) {
printf("\n--%s\n", sep);
if (line[read-1] == '\n')
line[read-1] = 0;
gen_file(f+1, (char *)line+1);
intext = 0;
continue;
if (f) {
*f = 0;
if (strchr(line, '/')) {
printf("\n--%s\n", sep);
if (line[read-1] == '\n')
line[read-1] = 0;
gen_file(f+1, (char *)line+1);
intext = 0;
continue;
}
}
}