mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 0b2e4880f5c80a97a8c4577591210185669ddb4a
parent e531f43ad68dc96144921530742d501370193593
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Wed,  5 Oct 2016 14:31:41 +0200

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

Diffstat:
mmime.c | 18++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/mmime.c b/mmime.c @@ -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; + } } }