--- libaitwww/src/mime.c 2012/03/10 00:26:49 1.2 +++ libaitwww/src/mime.c 2012/07/31 11:56:16 1.3.4.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: mime.c,v 1.2 2012/03/10 00:26:49 misho Exp $ +* $Id: mime.c,v 1.3.4.1 2012/07/31 11:56:16 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -45,7 +45,6 @@ SUCH DAMAGE. */ #include "global.h" #include "mime.h" -#include "tools.h" static int decode_quoted(char *, int, char *); @@ -170,7 +169,7 @@ hdrValue(const char *str, size_t len, const char **end e = str + len; while (str < e) { if (!(crlf = findtextpos(str, e - str, CRLF, strlen(CRLF)))) { - www_SetErr(EBADMSG, "Bad header format of MIME part"); + www_SetErr(EFAULT, "Bad header format of MIME part"); return NULL; } @@ -362,7 +361,7 @@ mime_parseMultiPart(const char *str, size_t len, const /* check boundary tag */ if (memcmp(str, strstr(bd[0].iov_base, "--"), strlen(strstr(bd[0].iov_base, "--")))) { - www_SetErr(EBADMSG, "Bad content data, not found boundary tag"); + www_SetErr(EFAULT, "Bad content data, not found boundary tag"); free(bd[1].iov_base); free(bd[0].iov_base); free(mime); @@ -496,7 +495,7 @@ mime_parseHeader(struct tagMIME * __restrict m, const colon = memchr(str, ':', e - str); eoh = findtextpos(str, e - str, CRLF, strlen(CRLF)); if (!colon || !eoh || colon > eoh) { - www_SetErr(EBADMSG, "Bad MIME format message"); + www_SetErr(EFAULT, "Bad MIME format message"); freeHeader(m); return -1; }