aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/misc.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/misc.h b/src/misc.h
index e52b93bd..7327846d 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -33,13 +33,14 @@ static inline void a_Misc_parse_content_disposition(const char *disposition, cha
const char terminators[] = " ;\t";
const char *str, *s;
- if (type)
- *type = NULL;
- if (filename)
- *filename = NULL;
- if (!(str = disposition))
+ /* All are mandatory */
+ if (!disposition || !type || !filename)
return;
+ *type = NULL;
+ *filename = NULL;
+ str = disposition;
+
for (s = str; *s && d_isascii((uchar_t)*s) && !iscntrl((uchar_t)*s) &&
!strchr(tspecials_space, *s); s++) ;
if (type && !(s == str))