aboutsummaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-11-12 20:35:34 +0000
committercorvid <corvid@lavabit.com>2011-11-12 20:35:34 +0000
commit57b7ee6eb3b0ee9db40ea5a143383ba595c7dad6 (patch)
tree0fd03d9bc8e33f39e7947ab7d65e151611a1b3e3 /src/misc.c
parentfa8f58b6cd95be0497bc13351ad3479c12e882a4 (diff)
some isascii()
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/misc.c b/src/misc.c
index 5efcf1de..0181a125 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -221,14 +221,14 @@ void a_Misc_parse_content_type(const char *type, char **major, char **minor,
if (!(str = type))
return;
- for (s = str; *s && !iscntrl((uchar_t)*s) && !strchr(tspecials_space, *s);
- s++) ;
+ for (s = str; *s && isascii((uchar_t)*s) && !iscntrl((uchar_t)*s) &&
+ !strchr(tspecials_space, *s); s++) ;
if (major)
*major = dStrndup(str, s - str);
if (*s == '/') {
- for (str = ++s;
- *s && !iscntrl((uchar_t)*s) && !strchr(tspecials_space, *s); s++) ;
+ for (str = ++s; *s && isascii((uchar_t)*s) && !iscntrl((uchar_t)*s) &&
+ !strchr(tspecials_space, *s); s++) ;
if (minor)
*minor = dStrndup(str, s - str);
}