X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5dd6771b28c257af405d7248639ed0e3bcdce38b..e0e0c1e0fce54f31e8b126d78a0b364208f7d36f:/h/mime.h diff --git a/h/mime.h b/h/mime.h index 3e50ce2c..2f8a6a32 100644 --- a/h/mime.h +++ b/h/mime.h @@ -13,7 +13,9 @@ #define DISPO_FIELD "Content-Disposition" #define MD5_FIELD "Content-MD5" -#define isatom(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \ +#define isatom(c) (isascii((unsigned char) c) \ + && !isspace ((unsigned char) c) \ + && !iscntrl ((unsigned char) c) && (c) != '(' \ && (c) != ')' && (c) != '<' && (c) != '>' \ && (c) != '@' && (c) != ',' && (c) != ';' \ && (c) != ':' && (c) != '\\' && (c) != '"' \ @@ -23,7 +25,9 @@ * Test for valid characters used in "token" * as defined in RFC2045 */ -#define istoken(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \ +#define istoken(c) (isascii((unsigned char) c) \ + && !isspace ((unsigned char) c) \ + && !iscntrl ((unsigned char) c) && (c) != '(' \ && (c) != ')' && (c) != '<' && (c) != '>' \ && (c) != '@' && (c) != ',' && (c) != ';' \ && (c) != ':' && (c) != '\\' && (c) != '"' \