summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rfc2045/reformime.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rfc2045/reformime.c b/rfc2045/reformime.c
index 8bdfa6c..302fdc6 100644
--- a/rfc2045/reformime.c
+++ b/rfc2045/reformime.c
@@ -1197,10 +1197,11 @@ int rc=0;
}
else if (dodecode)
{
- mimesection = strtok(section,",");
+ mimesection = section ? strtok(section,","):NULL;
do {
print_decode(p, mimesection);
- mimesection = strtok(NULL,",");
+ if (mimesection)
+ mimesection = strtok(NULL,",");
} while (mimesection != NULL);
}
else if (dorewrite)