Fix using strings deprecated in c++11

This commit is contained in:
Alexander Skovpen
2018-07-12 21:36:37 +03:00
committed by dukelsky
parent 3c52692ffc
commit a61ee2e300
37 changed files with 1035 additions and 1035 deletions

View File

@@ -66,7 +66,7 @@ DllEntryPoint (HINSTANCE hInstance, DWORD seginfo,
#endif
#endif
char * fptools_id = "$Id$";
char * fptools_id = (char *)"$Id$";
/*
* some versions of free can't handle a NULL pointer properly

View File

@@ -54,7 +54,7 @@
#include <fptools.h>
#include <uustring.h>
char * uucheck_id = "$Id$";
char * uucheck_id = (char *)"$Id$";
/*
* Arbitrary number. This is the maximum number of part numbers we
@@ -79,13 +79,13 @@ int lastvalid, lastenc, nofnum;
char *uucheck_lastname;
char *uucheck_tempname;
static int lastpart = 0;
static char *nofname = "UNKNOWN";
static char *nofname = (char *)"UNKNOWN";
/*
* special characters we allow an unquoted filename to have
*/
char *uufnchars = "._-~!$@";
char *uufnchars = (char *)"._-~!$@";
/*
* Policy for extracting a part number from the subject line.
@@ -93,7 +93,7 @@ char *uufnchars = "._-~!$@";
*/
static char *brackchr[] = {
"()[]", "[]()"
(char *)"()[]", (char *)"[]()"
};
/*
@@ -135,14 +135,14 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
* a file named "Repost" :-)
**/
if (_FP_strnicmp (subject, "repost", 6) == 0)
if (_FP_strnicmp (subject, (char *)"repost", 6) == 0)
subject += 6;
if (_FP_strnicmp (subject, "re:", 3) == 0)
if (_FP_strnicmp (subject, (char *)"re:", 3) == 0)
subject += 3;
while (*subject == ' ' || *subject == ':') subject++;
part = _FP_stristr (subject, "part");
part = _FP_stristr (subject, (char *)"part");
if (part == subject) {
subject += 4;
while (*subject == ' ') subject++;
@@ -223,7 +223,7 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
iter = ptr;
count = length = alflag = 0;
if (_FP_strnicmp (ptr, "ftp", 3) == 0) {
if (_FP_strnicmp (ptr, (char*)"ftp", 3) == 0) {
/* hey, that's an ftp address */
while (g_isalpha(*ptr) || isdigit (*ptr) || *ptr == '.')
ptr++;
@@ -251,8 +251,8 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
length = 0;
continue;
}
if (_FP_strnicmp (iter, "edu", 3) == 0 ||
_FP_strnicmp (iter, "gov", 3) == 0) {
if (_FP_strnicmp (iter, (char *)"edu", 3) == 0 ||
_FP_strnicmp (iter, (char *)"gov", 3) == 0) {
/* hey, that's an ftp address */
while (g_isalpha(*iter) || isdigit (*iter) || *iter == '.')
iter++;
@@ -381,7 +381,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
*whend = NULL; bdel[1] = '\0';
iter = NULL;
delim = "";
delim = (char *)"";
if (subject == NULL)
return -1;
@@ -428,7 +428,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
while (iter[count] == ' ' || iter[count] == '#' ||
iter[count] == '/' || iter[count] == '\\') count++;
if (_FP_strnicmp (iter + count, "of", 2) == 0)
if (_FP_strnicmp (iter + count, (char *)"of", 2) == 0)
count += 2;
while (iter[count] == ' ') count++;
@@ -496,7 +496,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
*/
if (length == 0) {
if ((iter = _FP_stristr (subject, "part")) != NULL) {
if ((iter = _FP_stristr (subject, (char *)"part")) != NULL) {
iter += 4;
while (isspace (*iter) || *iter == '.' || *iter == '-')
@@ -506,16 +506,16 @@ UUGetPartNo (char *subject, char **where, char **whend)
length++;
if (length == 0) {
if (_FP_strnicmp (iter, "one", 3) == 0) length = 1;
else if (_FP_strnicmp (iter, "two", 3) == 0) length = 2;
else if (_FP_strnicmp (iter, "three", 5) == 0) length = 3;
else if (_FP_strnicmp (iter, "four", 4) == 0) length = 4;
else if (_FP_strnicmp (iter, "five", 4) == 0) length = 5;
else if (_FP_strnicmp (iter, "six", 3) == 0) length = 6;
else if (_FP_strnicmp (iter, "seven", 5) == 0) length = 7;
else if (_FP_strnicmp (iter, "eight", 5) == 0) length = 8;
else if (_FP_strnicmp (iter, "nine", 4) == 0) length = 9;
else if (_FP_strnicmp (iter, "ten", 3) == 0) length = 10;
if (_FP_strnicmp (iter, (char *)"one", 3) == 0) length = 1;
else if (_FP_strnicmp (iter, (char *)"two", 3) == 0) length = 2;
else if (_FP_strnicmp (iter, (char *)"three", 5) == 0) length = 3;
else if (_FP_strnicmp (iter, (char *)"four", 4) == 0) length = 4;
else if (_FP_strnicmp (iter, (char *)"five", 4) == 0) length = 5;
else if (_FP_strnicmp (iter, (char *)"six", 3) == 0) length = 6;
else if (_FP_strnicmp (iter, (char *)"seven", 5) == 0) length = 7;
else if (_FP_strnicmp (iter, (char *)"eight", 5) == 0) length = 8;
else if (_FP_strnicmp (iter, (char *)"nine", 4) == 0) length = 9;
else if (_FP_strnicmp (iter, (char *)"ten", 3) == 0) length = 10;
if (length && (*whend = strchr (iter, ' '))) {
*where = iter;
@@ -526,7 +526,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
}
else {
*where = iter;
delim = "of";
delim = (char *)"of";
}
}
}
@@ -536,7 +536,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
*/
if (length == 0) {
if ((iter = _FP_strirstr (subject, "of")) != NULL) {
if ((iter = _FP_strirstr (subject, (char *)"of")) != NULL) {
while (iter>subject && isspace (*(iter-1)))
iter--;
if (isdigit(*(iter-1))) {
@@ -550,7 +550,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
ptr++; length++;
}
*where = iter;
delim = "of";
delim = (char *)"of";
}
}
}
@@ -635,18 +635,18 @@ UUGetPartNo (char *subject, char **where, char **whend)
/*
* some people use the strangest things, including spelling mistakes :-)
*/
if ((iter = _FP_stristr (subject, "first")) != NULL) length = 1;
else if ((iter = _FP_stristr (subject, "second")) != NULL) length = 2;
else if ((iter = _FP_stristr (subject, "third")) != NULL) length = 3;
else if ((iter = _FP_stristr (subject, "forth")) != NULL) length = 4;
else if ((iter = _FP_stristr (subject, "fourth")) != NULL) length = 4;
else if ((iter = _FP_stristr (subject, "fifth")) != NULL) length = 5;
else if ((iter = _FP_stristr (subject, "sixth")) != NULL) length = 6;
else if ((iter = _FP_stristr (subject, "seventh")) != NULL) length = 7;
else if ((iter = _FP_stristr (subject, "eigth")) != NULL) length = 8;
else if ((iter = _FP_stristr (subject, "nineth")) != NULL) length = 9;
else if ((iter = _FP_stristr (subject, "ninth")) != NULL) length = 9;
else if ((iter = _FP_stristr (subject, "tenth")) != NULL) length = 10;
if ((iter = _FP_stristr (subject, (char *)"first")) != NULL) length = 1;
else if ((iter = _FP_stristr (subject, (char *)"second")) != NULL) length = 2;
else if ((iter = _FP_stristr (subject, (char *)"third")) != NULL) length = 3;
else if ((iter = _FP_stristr (subject, (char *)"forth")) != NULL) length = 4;
else if ((iter = _FP_stristr (subject, (char *)"fourth")) != NULL) length = 4;
else if ((iter = _FP_stristr (subject, (char *)"fifth")) != NULL) length = 5;
else if ((iter = _FP_stristr (subject, (char *)"sixth")) != NULL) length = 6;
else if ((iter = _FP_stristr (subject, (char *)"seventh")) != NULL) length = 7;
else if ((iter = _FP_stristr (subject, (char *)"eigth")) != NULL) length = 8;
else if ((iter = _FP_stristr (subject, (char *)"nineth")) != NULL) length = 9;
else if ((iter = _FP_stristr (subject, (char *)"ninth")) != NULL) length = 9;
else if ((iter = _FP_stristr (subject, (char *)"tenth")) != NULL) length = 10;
else iter = NULL;
if (length && iter && (*whend = strchr (iter, ' '))) {
@@ -1097,8 +1097,8 @@ UUInsertPartToList (uufile *data)
if (data->partno == fiter->partno) {
if (fiter->data->subject == NULL)
return UURET_NODATA;
else if (_FP_stristr (fiter->data->subject, "repost") != NULL &&
_FP_stristr (data->data->subject, "repost") == NULL)
else if (_FP_stristr (fiter->data->subject, (char *)"repost") != NULL &&
_FP_stristr (data->data->subject, (char *)"repost") == NULL)
return UURET_NODATA;
else if (fiter->data->uudet && !data->data->uudet)
return UURET_NODATA;
@@ -1439,7 +1439,7 @@ UUCheckGlobalList (void)
*/
_FP_free (liter->filename);
if (liter->subfname && liter->subfname[0] &&
_FP_strpbrk (liter->subfname, "()[];: ") == NULL)
_FP_strpbrk (liter->subfname, (char *)"()[];: ") == NULL)
liter->filename = _FP_strdup (liter->subfname);
else {
sprintf (uucheck_tempname, "%s.%03d", nofname, ++nofnum);

View File

@@ -60,7 +60,7 @@
#endif
#endif
char * uuencode_id = "$Id$";
char * uuencode_id = (char *)"$Id$";
#if 0
/*
@@ -192,22 +192,22 @@ typedef struct {
*/
static mimemap mimetable[] = {
{ "gif", "image/gif" }, /* Grafics Interchange Format */
{ "jpg", "image/jpeg" }, /* JFIF encoded files */
{ "jpeg", "image/jpeg" },
{ "tif", "image/tiff" }, /* Tag Image File Format */
{ "tiff", "image/tiff" },
{ "cgm", "image/cgm" }, /* Computer Graphics Metafile */
{ "au", "audio/basic" }, /* 8kHz ulaw audio data */
{ "mov", "video/quicktime" }, /* Apple Quicktime */
{ "qt", "video/quicktime" }, /* Also infrequently used */
{ "mpeg", "video/mpeg" }, /* Motion Picture Expert Group */
{ "mpg", "video/mpeg" },
{ "mp2", "video/mpeg" }, /* dito, MPEG-2 encoded files */
{ "mp3", "audio/mpeg" }, /* dito, MPEG-3 encoded files */
{ "ps", "application/postscript" }, /* Postscript Language */
{ "zip", "application/zip" }, /* ZIP archive */
{ "doc", "application/msword"},/* assume Microsoft Word */
{ (char *)"gif", (char *)"image/gif" }, /* Grafics Interchange Format */
{ (char *)"jpg", (char *)"image/jpeg" }, /* JFIF encoded files */
{ (char *)"jpeg", (char *)"image/jpeg" },
{ (char *)"tif", (char *)"image/tiff" }, /* Tag Image File Format */
{ (char *)"tiff", (char *)"image/tiff" },
{ (char *)"cgm", (char *)"image/cgm" }, /* Computer Graphics Metafile */
{ (char *)"au", (char *)"audio/basic" }, /* 8kHz ulaw audio data */
{ (char *)"mov", (char *)"video/quicktime" }, /* Apple Quicktime */
{ (char *)"qt", (char *)"video/quicktime" }, /* Also infrequently used */
{ (char *)"mpeg", (char *)"video/mpeg" }, /* Motion Picture Expert Group */
{ (char *)"mpg", (char *)"video/mpeg" },
{ (char *)"mp2", (char *)"video/mpeg" }, /* dito, MPEG-2 encoded files */
{ (char *)"mp3", (char *)"audio/mpeg" }, /* dito, MPEG-3 encoded files */
{ (char *)"ps", (char *)"application/postscript" }, /* Postscript Language */
{ (char *)"zip", (char *)"application/zip" }, /* ZIP archive */
{ (char *)"doc", (char *)"application/msword"},/* assume Microsoft Word */
{ NULL, NULL }
};
@@ -697,7 +697,7 @@ UUEncodeMulti (FILE *outfile, FILE *infile, char *infname, int encoding,
}
if (mimetype == NULL && (encoding == PT_ENCODED || encoding == QP_ENCODED)) {
mimetype = "text/plain";
mimetype = (char *)"text/plain";
}
/*
@@ -884,7 +884,7 @@ UUEncodePartial (FILE *outfile, FILE *infile,
}
if (mimetype == NULL && (encoding==PT_ENCODED || encoding==QP_ENCODED)) {
mimetype = "text/plain";
mimetype = (char *)"text/plain";
}
/*
@@ -1535,7 +1535,7 @@ UUE_PrepSingleExt (FILE *outfile, FILE *infile,
mimetype = NULL;
if (mimetype == NULL && (encoding == PT_ENCODED || encoding == QP_ENCODED)) {
mimetype = "text/plain";
mimetype = (char *)"text/plain";
}
if ((subline = (char *) malloc (len)) == NULL) {

View File

@@ -81,7 +81,7 @@
#include <fptools.h>
#include <uustring.h>
char * uulib_id = "$Id$";
char * uulib_id = (char *)"$Id$";
#ifdef SYSTEM_WINDLL
BOOL _export WINAPI

View File

@@ -60,7 +60,7 @@
#include <fptools.h>
#include <uustring.h>
char * uunconc_id = "$Id$";
char * uunconc_id = (char *)"$Id$";
/* for braindead systems */
#ifndef SEEK_SET
@@ -203,8 +203,8 @@ UUBrokenByNetscape (char *string)
if (string==NULL || (len=strlen(string))<3)
return 0;
if ((ptr = _FP_stristr (string, "<a href=")) != NULL) {
if (_FP_stristr (string, "</a>") > ptr)
if ((ptr = _FP_stristr (string, (char *)"<a href=")) != NULL) {
if (_FP_stristr (string, (char *)"</a>") > ptr)
return 2;
}
@@ -217,7 +217,7 @@ UUBrokenByNetscape (char *string)
if (*--ptr == ' ') ptr--;
ptr--;
if (_FP_strnicmp (ptr, "<a", 2) == 0)
if (_FP_strnicmp (ptr, (char *)"<a", 2) == 0)
return 1;
return 0;
@@ -251,9 +251,9 @@ UUNetscapeCollapse (char *string)
*/
while (*p1) {
if (*p1 == '&') {
if (_FP_strnicmp (p1, "&amp;", 5) == 0) { p1+=5; *p2++='&'; res=1; }
else if (_FP_strnicmp (p1, "&lt;", 4) == 0) { p1+=4; *p2++='<'; res=1; }
else if (_FP_strnicmp (p1, "&gt;", 4) == 0) { p1+=4; *p2++='>'; res=1; }
if (_FP_strnicmp (p1, (char *)"&amp;", 5) == 0) { p1+=5; *p2++='&'; res=1; }
else if (_FP_strnicmp (p1, (char *)"&lt;", 4) == 0) { p1+=4; *p2++='<'; res=1; }
else if (_FP_strnicmp (p1, (char *)"&gt;", 4) == 0) { p1+=4; *p2++='>'; res=1; }
else *p2++ = *p1++;
}
else *p2++ = *p1++;
@@ -266,16 +266,16 @@ UUNetscapeCollapse (char *string)
while (*p1) {
if (*p1 == '<') {
if ((_FP_strnicmp (p1, "<ahref=", 7) == 0 ||
_FP_strnicmp (p1, "<a href=",8) == 0) &&
(_FP_strstr (p1, "</a>") != 0 || _FP_strstr (p1, "</A>") != 0)) {
if ((_FP_strnicmp (p1, (char *)"<ahref=", 7) == 0 ||
_FP_strnicmp (p1, (char *)"<a href=",8) == 0) &&
(_FP_strstr (p1, (char *)"</a>") != 0 || _FP_strstr (p1, (char *)"</A>") != 0)) {
while (*p1 && *p1!='>') p1++;
if (*p1=='\0' || *(p1+1)!='<') return 0;
p1++;
while (*p1 && (*p1!='<' || _FP_strnicmp(p1,"</a>",4)!=0)) {
while (*p1 && (*p1!='<' || _FP_strnicmp(p1,(char *)"</a>",4)!=0)) {
*p2++ = *p1++;
}
if (_FP_strnicmp(p1,"</a>",4) != 0)
if (_FP_strnicmp(p1,(char *)"</a>",4) != 0)
return 0;
p1+=4;
res=1;
@@ -1020,7 +1020,7 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
if ((flags&FL_PROPER) == 0) {
if (strncmp (line, "BEGIN", 5) == 0 &&
_FP_strstr (line, "CUT HERE") && !tf) { /* I hate these lines */
_FP_strstr (line, (char *)"CUT HERE") && !tf) { /* I hate these lines */
tc = tf = vlc = 0;
continue;
}
@@ -1036,7 +1036,7 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
haddh = 1;
continue;
}
if (_FP_strnicmp (line, "Content-Type", 12) == 0)
if (_FP_strnicmp (line, (char *)"Content-Type", 12) == 0)
hadct = 1;
}
@@ -1044,7 +1044,7 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
if ((method == UU_ENCODED || method == XX_ENCODED) &&
(strncmp (line, "begin ", 6) == 0 ||
strncmp (line, "section ", 8) == 0 ||
_FP_strnicmp (line, "<pre>begin ", 11) == 0)) { /* for LYNX */
_FP_strnicmp (line, (char *)"<pre>begin ", 11) == 0)) { /* for LYNX */
*state = DATA;
continue;
}
@@ -1058,10 +1058,10 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
}
else if (method == YENC_ENCODED &&
strncmp (line, "=ybegin ", 8) == 0 &&
_FP_strstr (line, " name=") != NULL) {
_FP_strstr (line, (char *)" name=") != NULL) {
*state = DATA;
if ((ptr = _FP_strstr (line, " size=")) != NULL) {
if ((ptr = _FP_strstr (line, (char *)" size=")) != NULL) {
ptr += 6;
yefilesize = atoi (ptr);
}
@@ -1069,12 +1069,12 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
yefilesize = -1;
}
if (_FP_strstr (line, " part=") != NULL) {
if (_FP_strstr (line, (char *)" part=") != NULL) {
if (_FP_fgets (line, 299, datain) == NULL) {
break;
}
if ((ptr = _FP_strstr (line, " end=")) == NULL) {
if ((ptr = _FP_strstr (line, (char *)" end=")) == NULL) {
break;
}
@@ -1110,14 +1110,14 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
if (*state == DATA && method == YENC_ENCODED &&
strncmp (line, "=yend ", 6) == 0) {
if ((ptr = _FP_strstr (line, " pcrc32=")) != NULL) {
if ((ptr = _FP_strstr (line, (char *)" pcrc32=")) != NULL) {
dword pcrc32 = strtoul (ptr + 8, NULL, 16);
if (pcrc32 != yepartcrc) {
UUMessage (uunconc_id, __LINE__, UUMSG_WARNING,
uustring (S_PCRC_MISMATCH), progress.curfile, progress.partno);
}
}
if ((ptr = _FP_strstr (line, " crc32=")) != NULL)
if ((ptr = _FP_strstr (line, (char *)" crc32=")) != NULL)
{
dword fcrc32 = strtoul (ptr + 7, NULL, 16);
if (fcrc32 != yefilecrc) {
@@ -1125,7 +1125,7 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
uustring (S_CRC_MISMATCH), progress.curfile);
}
}
if ((ptr = _FP_strstr (line, " size=")) != NULL)
if ((ptr = _FP_strstr (line, (char *)" size=")) != NULL)
{
size_t size = atol(ptr + 6);
if (size != yepartsize && yefilesize != -1) {
@@ -1295,9 +1295,9 @@ UUDecode (uulist *data)
return UURET_NODATA;
if (data->uudet == PT_ENCODED)
mode = "wt"; /* open text files in text mode */
mode = (char *)"wt"; /* open text files in text mode */
else
mode = "wb"; /* otherwise in binary */
mode = (char *)"wb"; /* otherwise in binary */
if ((data->binfile = tempnam (NULL, "uu")) == NULL) {
UUMessage (uunconc_id, __LINE__, UUMSG_ERROR,
@@ -1619,13 +1619,13 @@ UUQuickDecode (FILE *datain, FILE *dataout, char *boundary, long maxpos)
memset (&myenv, 0, sizeof (headers));
UUScanHeader (datain, &myenv);
if (_FP_stristr (myenv.ctenc, "uu") != NULL)
if (_FP_stristr (myenv.ctenc, (char *)"uu") != NULL)
encoding = UU_ENCODED;
else if (_FP_stristr (myenv.ctenc, "xx") != NULL)
else if (_FP_stristr (myenv.ctenc, (char *)"xx") != NULL)
encoding = XX_ENCODED;
else if (_FP_stricmp (myenv.ctenc, "base64") == 0)
else if (_FP_stricmp (myenv.ctenc, (char *)"base64") == 0)
encoding = B64ENCODED;
else if (_FP_stricmp (myenv.ctenc, "quoted-printable") == 0)
else if (_FP_stricmp (myenv.ctenc, (char *)"quoted-printable") == 0)
encoding = QP_ENCODED;
else
encoding = PT_ENCODED;

View File

@@ -58,7 +58,7 @@
#include <fptools.h>
#include <uustring.h>
char * uuscan_id = "$Id$";
char * uuscan_id = (char *)"$Id$";
/*
* Header fields we recognize as such. See RFC822. We add "From ",
@@ -69,25 +69,25 @@ char * uuscan_id = "$Id$";
*/
static char *knownmsgheaders[] = {
"From ", "Return-Path:", "Received:", "Reply-To:",
"From:", "Sender:", "Resent-Reply-To:", "Resent-From:",
"Resent-Sender:", "Date:", "Resent-Date:", "To:",
"Resent-To:", "Cc:", "Bcc:", "Resent-bcc:",
"Message-ID:", "Resent-Message-Id:", "In-Reply-To:",
"References:", "Keywords:", "Subject:", "Comments:",
(char *)"From ", (char *)"Return-Path:", (char *)"Received:", (char *)"Reply-To:",
(char *)"From:", (char *)"Sender:", (char *)"Resent-Reply-To:", (char *)"Resent-From:",
(char *)"Resent-Sender:", (char *)"Date:", (char *)"Resent-Date:", (char *)"To:",
(char *)"Resent-To:", (char *)"Cc:", (char *)"Bcc:", (char *)"Resent-bcc:",
(char *)"Message-ID:", (char *)"Resent-Message-Id:", (char *)"In-Reply-To:",
(char *)"References:", (char *)"Keywords:", (char *)"Subject:", (char *)"Comments:",
"Delivery-Date:", "Posted-Date:", "Received-Date:",
"Precedence:",
(char *)"Delivery-Date:", (char *)"Posted-Date:", (char *)"Received-Date:",
(char *)"Precedence:",
"Path:", "Newsgroups:", "Organization:", "Lines:",
"NNTP-Posting-Host:",
(char *)"Path:", (char *)"Newsgroups:", (char *)"Organization:", (char *)"Lines:",
(char *)"NNTP-Posting-Host:",
NULL
};
static char *knownmimeheaders[] = {
"Mime-Version:", "Content-Transfer-Encoding:",
"Content-Type:", "Content-Disposition:",
"Content-Description:", "Content-Length:",
(char *)"Mime-Version:", (char *)"Content-Transfer-Encoding:",
(char *)"Content-Type:", (char *)"Content-Disposition:",
(char *)"Content-Description:", (char *)"Content-Length:",
NULL
};
@@ -333,86 +333,86 @@ ParseHeader (headers *theheaders, char *line)
if (line == NULL)
return theheaders;
if (_FP_strnicmp (line, "From:", 5) == 0) {
if (_FP_strnicmp (line, (char *)"From:", 5) == 0) {
if (theheaders->from) return theheaders;
variable = &theheaders->from;
value = line+5;
delimit = 0;
}
else if (_FP_strnicmp (line, "Subject:", 8) == 0) {
else if (_FP_strnicmp (line, (char *)"Subject:", 8) == 0) {
if (theheaders->subject) return theheaders;
variable = &theheaders->subject;
value = line+8;
delimit = 0;
}
else if (_FP_strnicmp (line, "To:", 3) == 0) {
else if (_FP_strnicmp (line, (char *)"To:", 3) == 0) {
if (theheaders->rcpt) return theheaders;
variable = &theheaders->rcpt;
value = line+3;
delimit = 0;
}
else if (_FP_strnicmp (line, "Date:", 5) == 0) {
else if (_FP_strnicmp (line, (char *)"Date:", 5) == 0) {
if (theheaders->date) return theheaders;
variable = &theheaders->date;
value = line+5;
delimit = 0;
}
else if (_FP_strnicmp (line, "Mime-Version:", 13) == 0) {
else if (_FP_strnicmp (line, (char *)"Mime-Version:", 13) == 0) {
if (theheaders->mimevers) return theheaders;
variable = &theheaders->mimevers;
value = line+13;
delimit = 0;
}
else if (_FP_strnicmp (line, "Content-Type:", 13) == 0) {
else if (_FP_strnicmp (line, (char *)"Content-Type:", 13) == 0) {
if (theheaders->ctype) return theheaders;
variable = &theheaders->ctype;
value = line+13;
delimit = ';';
/* we can probably extract more information */
if ((ptr = _FP_stristr (line, "boundary")) != NULL) {
if ((ptr = _FP_stristr (line, (char *)"boundary")) != NULL) {
if ((thenew = ParseValue (ptr))) {
if (theheaders->boundary) free (theheaders->boundary);
theheaders->boundary = _FP_strdup (thenew);
}
}
if ((ptr = _FP_stristr (line, "name")) != NULL) {
if ((ptr = _FP_stristr (line, (char *)"name")) != NULL) {
if ((thenew = ParseValue (ptr))) {
if (theheaders->fname) free (theheaders->fname);
theheaders->fname = _FP_strdup (thenew);
}
}
if ((ptr = _FP_stristr (line, "id")) != NULL) {
if ((ptr = _FP_stristr (line, (char *)"id")) != NULL) {
if ((thenew = ParseValue (ptr))) {
if (theheaders->mimeid) free (theheaders->mimeid);
theheaders->mimeid = _FP_strdup (thenew);
}
}
if ((ptr = _FP_stristr (line, "number")) != NULL) {
if ((ptr = _FP_stristr (line, (char *)"number")) != NULL) {
if ((thenew = ParseValue (ptr))) {
theheaders->partno = atoi (thenew);
}
}
if ((ptr = _FP_stristr (line, "total")) != NULL) {
if ((ptr = _FP_stristr (line, (char *)"total")) != NULL) {
if ((thenew = ParseValue (ptr))) {
theheaders->numparts = atoi (thenew);
}
}
}
else if (_FP_strnicmp (line, "Content-Transfer-Encoding:", 26) == 0) {
else if (_FP_strnicmp (line, (char *)"Content-Transfer-Encoding:", 26) == 0) {
if (theheaders->ctenc) return theheaders;
variable = &theheaders->ctenc;
value = line+26;
delimit = ';';
}
else if (_FP_strnicmp (line, "Content-Disposition:", 20) == 0) {
else if (_FP_strnicmp (line, (char *)"Content-Disposition:", 20) == 0) {
/*
* Some encoders mention the original filename as parameter to
* Content-Type, others as parameter to Content-Disposition. We
* do prefer the first solution, but accept this situation, too.
* TODO: Read RFC1806
*/
if ((ptr = _FP_stristr (line, "name")) != NULL) {
if ((ptr = _FP_stristr (line, (char *)"name")) != NULL) {
if (theheaders->fname == NULL && (thenew=ParseValue(ptr)) != NULL) {
theheaders->fname = _FP_strdup (thenew);
}
@@ -626,9 +626,9 @@ ScanData (FILE *datei, char *fname, int *errcode,
break;
}
if (boundary != NULL && line[0] == 'C' && line[1] == 'o' &&
_FP_strnicmp (line, "Content-Type:", 13) == 0) {
_FP_strnicmp (line, (char *)"Content-Type:", 13) == 0) {
ptr = ScanHeaderLine (datei, line);
p2 = (ptr)?_FP_stristr(ptr,"boundary"):NULL;
p2 = (ptr)?_FP_stristr(ptr,(char *)"boundary"):NULL;
p3 = (p2)?ParseValue(p2):NULL;
if (p3 && strcmp (p3, boundary) == 0) {
@@ -641,7 +641,7 @@ ScanData (FILE *datei, char *fname, int *errcode,
}
if (strncmp (line, "begin ", 6) == 0 ||
_FP_strnicmp (line, "<pre>begin ", 11) == 0) {
_FP_strnicmp (line, (char *)"<pre>begin ", 11) == 0) {
if ((result->begin || result->end ||
result->uudet == B64ENCODED ||
result->uudet == BH_ENCODED) && !uu_more_mime) {
@@ -702,19 +702,19 @@ ScanData (FILE *datei, char *fname, int *errcode,
* Detect a UUDeview-Style header
*/
if ((_FP_strnicmp (line, "_=_ Part ", 9) == 0 ||
_FP_strnicmp (line, "section ", 8) == 0) &&
if ((_FP_strnicmp (line, (char *)"_=_ Part ", 9) == 0 ||
_FP_strnicmp (line, (char *)"section ", 8) == 0) &&
result->uudet != YENC_ENCODED) {
if (result->uudet) {
fseek (datei, oldposition, SEEK_SET);
break;
}
result->partno = atoi (line + 8);
if ((ptr = _FP_stristr (line, " of ")) != NULL) {
if ((ptr = _FP_stristr (line, (char *)" of ")) != NULL) {
int maxpno = atoi (ptr + 4);
if(maxpno != 0) result->maxpno = maxpno;
}
if ((ptr = _FP_stristr (line, "of file ")) != NULL) {
if ((ptr = _FP_stristr (line, (char *)"of file ")) != NULL) {
ptr += 8;
while (isspace (*ptr)) ptr++;
p2 = ptr;
@@ -740,8 +740,8 @@ ScanData (FILE *datei, char *fname, int *errcode,
*/
if (boundary == NULL && !ismime && !uu_more_mime &&
result->uudet != YENC_ENCODED) {
if (_FP_strnicmp (line, "Content-Type", 12) == 0 ||
_FP_strnicmp (line, "X-Orcl-Content-Type", 19) == 0) {
if (_FP_strnicmp (line, (char *)"Content-Type", 12) == 0 ||
_FP_strnicmp (line, (char *)"X-Orcl-Content-Type", 19) == 0) {
/*
* We use Content-Type to mark a new attachment and split the file.
* However, we do not split if we haven't found anything encoded yet.
@@ -764,15 +764,15 @@ ScanData (FILE *datei, char *fname, int *errcode,
ctline=0;
hadct=1;
}
if ((ptr = _FP_stristr (line, "number=")) && ctline<4) {
if ((ptr = _FP_stristr (line, (char *)"number=")) && ctline<4) {
ptr += 7; if (*ptr == '"') ptr++;
result->partno = atoi (ptr);
}
if ((ptr = _FP_stristr (line, "total=")) && ctline<4) {
if ((ptr = _FP_stristr (line, (char *)"total=")) && ctline<4) {
ptr += 6; if (*ptr == '"') ptr++;
result->maxpno = atoi (ptr);
}
if ((ptr = _FP_stristr (line, "name=")) && ctline<4) {
if ((ptr = _FP_stristr (line, (char *)"name=")) && ctline<4) {
ptr += 5;
while (isspace (*ptr)) ptr++;
if (*ptr == '"' && *(ptr+1) && (p2 = strchr (ptr+2, '"')) != NULL) {
@@ -806,7 +806,7 @@ ScanData (FILE *datei, char *fname, int *errcode,
*p2 = c;
}
}
if ((ptr = _FP_stristr (line, "id=")) && ctline<4) {
if ((ptr = _FP_stristr (line, (char *)"id=")) && ctline<4) {
p2 = ptr += 3;
if (*p2 == '"') {
p2 = strchr (++ptr, '"');
@@ -850,14 +850,14 @@ ScanData (FILE *datei, char *fname, int *errcode,
if (boundary == NULL && !ismime && !uu_more_mime && dflag <= 1 &&
line[0] == '-' && line[1] == '-' && strlen(line+2)>10 &&
(((ptr = _FP_strrstr (line+2, "--")) == NULL) ||
(((ptr = _FP_strrstr (line+2, (char *)"--")) == NULL) ||
(*(ptr+2) != '\012' && *(ptr+2) != '\015')) &&
_FP_strstr (line+2, "_=_") != NULL) {
_FP_strstr (line+2, (char *)"_=_") != NULL) {
prevlinefirstchar = line[0];
if (_FP_fgets (line, 255, datei) == NULL) {
break;
}
if (_FP_strnicmp (line, "Content-", 8) == 0) {
if (_FP_strnicmp (line, (char *)"Content-", 8) == 0) {
/*
* Okay, let's do it. This breaks out of ScanData. ScanPart will
* recognize the boundary on the next call and use it.
@@ -872,7 +872,7 @@ ScanData (FILE *datei, char *fname, int *errcode,
*/
if (strncmp (line, "=ybegin ", 8) == 0 &&
_FP_strstr (line, " name=") != NULL) {
_FP_strstr (line, (char *)" name=") != NULL) {
if ((result->begin || result->end) && !uu_more_mime) {
fseek (datei, oldposition, SEEK_SET);
break;
@@ -883,7 +883,7 @@ ScanData (FILE *datei, char *fname, int *errcode,
*/
_FP_free (result->filename);
ptr = _FP_strstr (line, " name=") + 6;
ptr = _FP_strstr (line, (char *)" name=") + 6;
result->filename = _FP_strdup (ptr);
while (isspace (result->filename[strlen(result->filename)-1]))
@@ -893,7 +893,7 @@ ScanData (FILE *datei, char *fname, int *errcode,
* Determine size
*/
if ((ptr = _FP_strstr (line, " size=")) != NULL) {
if ((ptr = _FP_strstr (line, (char *)" size=")) != NULL) {
ptr += 6;
yefilesize = atoi (ptr);
}
@@ -905,7 +905,7 @@ ScanData (FILE *datei, char *fname, int *errcode,
* check for multipart file and read =ypart line
*/
if ((ptr = _FP_strstr (line, " part=")) != NULL) {
if ((ptr = _FP_strstr (line, (char *)" part=")) != NULL) {
result->partno = atoi (ptr + 6);
if (result->partno == 1) {
@@ -922,7 +922,7 @@ ScanData (FILE *datei, char *fname, int *errcode,
break;
}
if ((ptr = _FP_strstr (line, " end=")) == NULL) {
if ((ptr = _FP_strstr (line, (char *)" end=")) == NULL) {
break;
}
@@ -1362,7 +1362,7 @@ ScanData (FILE *datei, char *fname, int *errcode,
return 2;
else if (boundary && p3 &&
line[0] == 'C' && line[1] == 'o' &&
_FP_strnicmp (line, "Content-Type:", 13) == 0 &&
_FP_strnicmp (line, (char *)"Content-Type:", 13) == 0 &&
strcmp (p3, boundary) == 0)
return 2;
else if (IsKnownHeader (line))
@@ -1487,9 +1487,9 @@ ScanPart (FILE *datei, char *fname, int *errcode)
}
sstate.ismime = 1;
sstate.envelope.mimevers = _FP_strdup ("1.0");
sstate.envelope.mimevers = _FP_strdup ((char *)"1.0");
sstate.envelope.boundary = _FP_strdup (line+2);
sstate.envelope.ctype = _FP_strdup ("multipart/mixed");
sstate.envelope.ctype = _FP_strdup ((char *)"multipart/mixed");
sstate.mimestate = MS_SUBPART;
*errcode = UURET_CONT;
@@ -1592,14 +1592,14 @@ ScanPart (FILE *datei, char *fname, int *errcode)
* headers, don't be too picky about it.
*/
if (sstate.envelope.ctype && sstate.envelope.mimevers==NULL &&
_FP_stristr (sstate.envelope.ctype, "multipart") != NULL &&
_FP_stristr (sstate.envelope.ctype, (char *)"multipart") != NULL &&
sstate.envelope.boundary != NULL) {
sstate.envelope.mimevers = _FP_strdup ("1.0");
sstate.envelope.mimevers = _FP_strdup ((char *)"1.0");
hcount = hlcount.afternl;
}
else if (sstate.envelope.mimevers==NULL && sstate.envelope.ctype &&
sstate.envelope.fname && sstate.envelope.ctenc) {
sstate.envelope.mimevers = _FP_strdup ("1.0");
sstate.envelope.mimevers = _FP_strdup ((char *)"1.0");
hcount = hlcount.afternl;
}
@@ -1612,13 +1612,13 @@ ScanPart (FILE *datei, char *fname, int *errcode)
else if (sstate.envelope.mimevers != NULL) {
/* this is a MIME file. check the Content-Type */
sstate.ismime = 1;
if (_FP_stristr (sstate.envelope.ctype, "multipart") != NULL) {
if (_FP_stristr (sstate.envelope.ctype, (char *)"multipart") != NULL) {
if (sstate.envelope.boundary == NULL) {
UUMessage (uuscan_id, __LINE__, UUMSG_WARNING,
uustring (S_MIME_NO_BOUNDARY));
sstate.mimestate = MS_BODY;
_FP_free (sstate.envelope.ctype);
sstate.envelope.ctype = _FP_strdup ("text/plain");
sstate.envelope.ctype = _FP_strdup ((char *)"text/plain");
}
else {
sstate.mimestate = MS_PREAMBLE;
@@ -1718,7 +1718,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
result->filename = _FP_strdup (line);
result->origin = _FP_strdup (sstate.envelope.from);
result->mimeid = _FP_strdup (sstate.envelope.mimeid);
result->mimetype = _FP_strdup ("text/plain");
result->mimetype = _FP_strdup ((char *)"text/plain");
result->mode = 0644;
result->uudet = PT_ENCODED; /* plain text */
result->sfname = _FP_strdup (fname);
@@ -1791,7 +1791,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
result->filename = _FP_strdup (line);
result->origin = _FP_strdup (sstate.envelope.from);
result->mimeid = _FP_strdup (sstate.envelope.mimeid);
result->mimetype = _FP_strdup ("text/plain");
result->mimetype = _FP_strdup ((char *)"text/plain");
result->mode = 0644;
result->uudet = PT_ENCODED; /* plain text */
result->sfname = _FP_strdup (fname);
@@ -1856,7 +1856,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
/* check for begin and encoded data only at outermost level */
if (mssdepth == 0 && !uu_more_mime) {
if (strncmp (line, "begin ", 6) == 0 ||
_FP_strnicmp (line, "<pre>begin ", 11) == 0) {
_FP_strnicmp (line, (char *)"<pre>begin ", 11) == 0) {
preenc = prevpos;
begflag = 1;
}
@@ -1960,7 +1960,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
result->filename = _FP_strdup (line);
result->origin = _FP_strdup (sstate.envelope.from);
result->mimeid = _FP_strdup (sstate.envelope.mimeid);
result->mimetype = _FP_strdup ("text/plain");
result->mimetype = _FP_strdup ((char *)"text/plain");
result->mode = 0644;
result->uudet = PT_ENCODED; /* plain text */
result->sfname = _FP_strdup (fname);
@@ -2078,7 +2078,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
fseek (datei, prevpos, SEEK_SET);
}
if (_FP_stristr (localenv.ctype, "multipart") != NULL) {
if (_FP_stristr (localenv.ctype, (char *)"multipart") != NULL) {
/* oh no, not again */
if (mssdepth >= MSMAXDEPTH) {
/* Argh, what an isane message. Treat as plain text */
@@ -2120,23 +2120,23 @@ ScanPart (FILE *datei, char *fname, int *errcode)
* would then be correctly typed as `text/plain'.
*/
if (_FP_stristr (localenv.ctenc, "base64") != NULL)
if (_FP_stristr (localenv.ctenc, (char *)"base64") != NULL)
result->uudet = B64ENCODED;
else if (_FP_stristr (localenv.ctenc, "x-uue") != NULL) {
else if (_FP_stristr (localenv.ctenc, (char *)"x-uue") != NULL) {
result->uudet = UU_ENCODED;
result->begin = result->end = 1;
}
else if (_FP_stristr (localenv.ctenc, "x-yenc") != NULL) {
else if (_FP_stristr (localenv.ctenc, (char *)"x-yenc") != NULL) {
result->uudet = YENC_ENCODED;
result->begin = result->end = 1;
}
else if (_FP_stristr (localenv.ctenc, "quoted-printable") != NULL)
else if (_FP_stristr (localenv.ctenc, (char *)"quoted-printable") != NULL)
result->uudet = QP_ENCODED;
else if (_FP_stristr (localenv.ctenc, "7bit") != NULL ||
_FP_stristr (localenv.ctenc, "8bit") != NULL)
else if (_FP_stristr (localenv.ctenc, (char *)"7bit") != NULL ||
_FP_stristr (localenv.ctenc, (char *)"8bit") != NULL)
result->uudet = PT_ENCODED;
else if (_FP_stristr (localenv.ctype, "multipart") != NULL ||
_FP_stristr (localenv.ctype, "message") != NULL)
else if (_FP_stristr (localenv.ctype, (char *)"multipart") != NULL ||
_FP_stristr (localenv.ctype, (char *)"message") != NULL)
result->uudet = PT_ENCODED;
/*
@@ -2176,9 +2176,9 @@ ScanPart (FILE *datei, char *fname, int *errcode)
* Content-Type: multipart/... boundary="same-boundary"
*/
if (line[0] == 'C' && line[1] == 'o' &&
_FP_strnicmp (line, "Content-Type:", 13) == 0) {
_FP_strnicmp (line, (char *)"Content-Type:", 13) == 0) {
ptr1 = ScanHeaderLine (datei, line);
ptr2 = (ptr1)?_FP_stristr(ptr1,"boundary"):NULL;
ptr2 = (ptr1)?_FP_stristr(ptr1,(char *)"boundary"):NULL;
ptr1 = (ptr2)?ParseValue(ptr2):NULL;
if (ptr1 && strcmp (ptr1, sstate.envelope.boundary) == 0)
break;
@@ -2336,9 +2336,9 @@ ScanPart (FILE *datei, char *fname, int *errcode)
strncmp (line+2, sstate.envelope.boundary, blen) == 0)
break;
if (line[0] == 'C' && line[1] == 'o' &&
_FP_strnicmp (line, "Content-Type:", 13) == 0) {
_FP_strnicmp (line, (char *)"Content-Type:", 13) == 0) {
ptr1 = ScanHeaderLine (datei, line);
ptr2 = (ptr1)?_FP_stristr(ptr1,"boundary"):NULL;
ptr2 = (ptr1)?_FP_stristr(ptr1,(char *)"boundary"):NULL;
ptr1 = (ptr2)?ParseValue(ptr2):NULL;
if (ptr1 && strcmp (ptr1, sstate.envelope.boundary) == 0)
break;
@@ -2419,7 +2419,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
*/
if (strcmp (localenv.mimevers, "1.0") == 0 &&
_FP_stristr (localenv.ctype, "text") != NULL &&
_FP_stristr (localenv.ctype, (char *)"text") != NULL &&
sstate.ismime && sstate.mimestate == MS_SUBPART &&
!uu_desperate) {
if (result->uudet == UU_ENCODED && !(result->begin || result->end)) {
@@ -2451,7 +2451,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
}
if (result->mimetype) _FP_free (result->mimetype);
if (result->uudet) {
if (_FP_stristr (localenv.ctype, "text") != NULL &&
if (_FP_stristr (localenv.ctype, (char *)"text") != NULL &&
result->uudet != QP_ENCODED && result->uudet != PT_ENCODED)
result->mimetype = NULL; /* better don't set it */
else
@@ -2496,8 +2496,8 @@ ScanPart (FILE *datei, char *fname, int *errcode)
*/
if (sstate.isfolder && sstate.ismime && sstate.mimestate == MS_BODY &&
_FP_stristr (sstate.envelope.ctype, "message") != NULL &&
_FP_stristr (sstate.envelope.ctype, "partial") != NULL) {
_FP_stristr (sstate.envelope.ctype, (char *)"message") != NULL &&
_FP_stristr (sstate.envelope.ctype, (char *)"partial") != NULL) {
result->startpos = ftell (datei);
@@ -2544,7 +2544,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
* Examine local header. We're mostly interested in the Content-Type
* and the Content-Transfer-Encoding.
*/
if (_FP_stristr (localenv.ctype, "multipart") != NULL) {
if (_FP_stristr (localenv.ctype, (char *)"multipart") != NULL) {
UUMessage (uuscan_id, __LINE__, UUMSG_WARNING,
uustring (S_MIME_PART_MULTI));
}
@@ -2561,25 +2561,25 @@ ScanPart (FILE *datei, char *fname, int *errcode)
if (localenv.ctype)
result->mimetype = _FP_strdup (localenv.ctype);
else
result->mimetype = _FP_strdup ("text/plain");
result->mimetype = _FP_strdup ((char *)"text/plain");
if (_FP_stristr (localenv.ctenc, "quoted-printable") != NULL)
if (_FP_stristr (localenv.ctenc, (char *)"quoted-printable") != NULL)
result->uudet = QP_ENCODED;
else if (_FP_stristr (localenv.ctenc, "base64") != NULL)
else if (_FP_stristr (localenv.ctenc, (char *)"base64") != NULL)
result->uudet = B64ENCODED;
else if (_FP_stristr (localenv.ctenc, "x-uue") != NULL) {
else if (_FP_stristr (localenv.ctenc, (char *)"x-uue") != NULL) {
result->uudet = UU_ENCODED;
result->begin = result->end = 1;
}
else if (_FP_stristr (localenv.ctenc, "x-yenc") != NULL) {
else if (_FP_stristr (localenv.ctenc, (char *)"x-yenc") != NULL) {
result->uudet = YENC_ENCODED;
result->begin = result->end = 1;
}
else if (_FP_stristr (localenv.ctenc, "7bit") != NULL ||
_FP_stristr (localenv.ctenc, "8bit") != NULL)
else if (_FP_stristr (localenv.ctenc, (char *)"7bit") != NULL ||
_FP_stristr (localenv.ctenc, (char *)"8bit") != NULL)
result->uudet = PT_ENCODED;
else if (_FP_stristr (localenv.ctype, "multipart") != NULL ||
_FP_stristr (localenv.ctype, "message") != NULL)
else if (_FP_stristr (localenv.ctype, (char *)"multipart") != NULL ||
_FP_stristr (localenv.ctype, (char *)"message") != NULL)
result->uudet = PT_ENCODED;
/*
@@ -2616,8 +2616,8 @@ ScanPart (FILE *datei, char *fname, int *errcode)
hcount = lcount = 0;
prevpos = ftell (datei);
if (_FP_stristr (localenv.ctype, "message") != NULL &&
_FP_stristr (localenv.ctype, "rfc822") != NULL) {
if (_FP_stristr (localenv.ctype, (char *)"message") != NULL &&
_FP_stristr (localenv.ctype, (char *)"rfc822") != NULL) {
/*
* skip over empty lines and local header
*/
@@ -2791,11 +2791,11 @@ ScanPart (FILE *datei, char *fname, int *errcode)
if (sstate.isfolder && sstate.ismime &&
sstate.mimestate == MS_BODY &&
(_FP_stristr (sstate.envelope.ctenc, "quoted-printable") != NULL ||
_FP_stristr (sstate.envelope.ctenc, "base64") != NULL ||
_FP_stristr (sstate.envelope.ctenc, "x-uue") != NULL ||
_FP_stristr (sstate.envelope.ctenc, "x-yenc") != NULL ||
_FP_stristr (sstate.envelope.ctype, "message") != NULL ||
(_FP_stristr (sstate.envelope.ctenc, (char *)"quoted-printable") != NULL ||
_FP_stristr (sstate.envelope.ctenc, (char *)"base64") != NULL ||
_FP_stristr (sstate.envelope.ctenc, (char *)"x-uue") != NULL ||
_FP_stristr (sstate.envelope.ctenc, (char *)"x-yenc") != NULL ||
_FP_stristr (sstate.envelope.ctype, (char *)"message") != NULL ||
sstate.envelope.fname != NULL)) {
if (sstate.envelope.subject)
@@ -2806,24 +2806,24 @@ ScanPart (FILE *datei, char *fname, int *errcode)
if (sstate.envelope.ctype)
result->mimetype = _FP_strdup (sstate.envelope.ctype);
else
result->mimetype = _FP_strdup ("text/plain");
result->mimetype = _FP_strdup ((char *)"text/plain");
if (_FP_stristr (sstate.envelope.ctenc, "quoted-printable") != NULL)
if (_FP_stristr (sstate.envelope.ctenc, (char *)"quoted-printable") != NULL)
result->uudet = QP_ENCODED;
else if (_FP_stristr (sstate.envelope.ctenc, "base64") != NULL)
else if (_FP_stristr (sstate.envelope.ctenc, (char *)"base64") != NULL)
result->uudet = B64ENCODED;
else if (_FP_stristr (sstate.envelope.ctenc, "x-uue") != NULL) {
else if (_FP_stristr (sstate.envelope.ctenc, (char *)"x-uue") != NULL) {
result->uudet = UU_ENCODED;
result->begin = result->end = 1;
}
else if (_FP_stristr (sstate.envelope.ctenc, "x-yenc") != NULL) {
else if (_FP_stristr (sstate.envelope.ctenc, (char *)"x-yenc") != NULL) {
result->uudet = YENC_ENCODED;
}
else if (_FP_stristr (sstate.envelope.ctenc, "7bit") != NULL ||
_FP_stristr (sstate.envelope.ctenc, "8bit") != NULL)
else if (_FP_stristr (sstate.envelope.ctenc, (char *)"7bit") != NULL ||
_FP_stristr (sstate.envelope.ctenc, (char *)"8bit") != NULL)
result->uudet = PT_ENCODED;
else if (_FP_stristr (sstate.envelope.ctype, "multipart") != NULL ||
_FP_stristr (sstate.envelope.ctype, "message") != NULL ||
else if (_FP_stristr (sstate.envelope.ctype, (char *)"multipart") != NULL ||
_FP_stristr (sstate.envelope.ctype, (char *)"message") != NULL ||
sstate.envelope.fname != NULL)
result->uudet = PT_ENCODED;
@@ -2852,8 +2852,8 @@ ScanPart (FILE *datei, char *fname, int *errcode)
hcount = lcount = 0;
prevpos = ftell (datei);
if (_FP_stristr (sstate.envelope.ctype, "message") != NULL &&
_FP_stristr (sstate.envelope.ctype, "rfc822") != NULL) {
if (_FP_stristr (sstate.envelope.ctype, (char *)"message") != NULL &&
_FP_stristr (sstate.envelope.ctype, (char *)"rfc822") != NULL) {
/*
* skip over empty lines and local header
*/
@@ -3015,7 +3015,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
*/
if ((sstate.envelope.ctype == NULL ||
_FP_stristr (sstate.envelope.ctype, "multipart") != NULL) &&
_FP_stristr (sstate.envelope.ctype, (char *)"multipart") != NULL) &&
!uu_more_mime) {
prevpos = ftell (datei);
while (!feof (datei)) {
@@ -3029,10 +3029,10 @@ ScanPart (FILE *datei, char *fname, int *errcode)
}
if (line[0] == '-' && line[1] == '-' &&
!IsLineEmpty (line+2) && !feof (datei)) {
ptr1 = _FP_strrstr (line+2, "--");
ptr1 = _FP_strrstr (line+2, (char *)"--");
ptr2 = ScanHeaderLine (datei, NULL);
if ((ptr1 == NULL || (*(ptr1+2) != '\012' && *(ptr1+2) != '\015')) &&
ptr2 && _FP_strnicmp (ptr2, "Content-", 8) == 0) {
ptr2 && _FP_strnicmp (ptr2, (char *)"Content-", 8) == 0) {
/*
* hmm, okay, let's do it!
*/
@@ -3047,7 +3047,7 @@ ScanPart (FILE *datei, char *fname, int *errcode)
ptr1++;
*ptr1 = '\0';
sstate.envelope.mimevers = _FP_strdup ("1.0");
sstate.envelope.mimevers = _FP_strdup ((char *)"1.0");
sstate.envelope.boundary = _FP_strdup (line+2);
/*

View File

@@ -49,7 +49,7 @@
#include <uuint.h>
#include <uustring.h>
char * uustring_id = "$Id$";
char * uustring_id = (char *)"$Id$";
typedef struct {
int code;
@@ -63,51 +63,51 @@ typedef struct {
static stringmap messages[] = {
/* I/O related errors/messages. Last parameter is strerror() */
{ S_NOT_OPEN_SOURCE, "Could not open source file %s: %s" },
{ S_NOT_OPEN_TARGET, "Could not open target file %s for writing: %s" },
{ S_NOT_OPEN_FILE, "Could not open file %s: %s" },
{ S_NOT_STAT_FILE, "Could not stat file %s: %s" },
{ S_SOURCE_READ_ERR, "Read error on source file: %s" },
{ S_READ_ERROR, "Error reading from %s: %s" },
{ S_IO_ERR_TARGET, "I/O error on target file %s: %s" },
{ S_WR_ERR_TARGET, "Write error on target file %s: %s" },
{ S_WR_ERR_TEMP, "Write error on temp file: %s" },
{ S_TMP_NOT_REMOVED, "Could not remove temp file %s: %s (ignored)" },
{ S_NOT_OPEN_SOURCE, (char *)"Could not open source file %s: %s" },
{ S_NOT_OPEN_TARGET, (char *)"Could not open target file %s for writing: %s" },
{ S_NOT_OPEN_FILE, (char *)"Could not open file %s: %s" },
{ S_NOT_STAT_FILE, (char *)"Could not stat file %s: %s" },
{ S_SOURCE_READ_ERR, (char *)"Read error on source file: %s" },
{ S_READ_ERROR, (char *)"Error reading from %s: %s" },
{ S_IO_ERR_TARGET, (char *)"I/O error on target file %s: %s" },
{ S_WR_ERR_TARGET, (char *)"Write error on target file %s: %s" },
{ S_WR_ERR_TEMP, (char *)"Write error on temp file: %s" },
{ S_TMP_NOT_REMOVED, (char *)"Could not remove temp file %s: %s (ignored)" },
/* some other problems */
{ S_OUT_OF_MEMORY, "Out of memory allocating %d bytes" },
{ S_TARGET_EXISTS, "Target file %s exists and overwriting is not allowed" },
{ S_NOT_RENAME, "Could not change name of %s to %s" },
{ S_ERR_ENCODING, "Error while encoding %s: %s" },
{ S_STAT_ONE_PART, "Could not stat input, encoding to one part only" },
{ S_PARM_CHECK, "Parameter check failed in %s" },
{ S_SHORT_BINHEX, "BinHex encoded file %s ended prematurely (%ld bytes left)" },
{ S_DECODE_CANCEL, "Decode operation canceled" },
{ S_ENCODE_CANCEL, "Encode operation canceled" },
{ S_SCAN_CANCEL, "Scanning canceled" },
{ S_SIZE_MISMATCH, "%s: Decoded size (%ld) does not match expected size (%ld)" },
{ S_PSIZE_MISMATCH, "%s part %d: Decoded size (%ld) does not match expected size (%ld)" },
{ S_CRC_MISMATCH, "CRC32 mismatch in %s. Decoded file probably corrupt." },
{ S_PCRC_MISMATCH, "PCRC32 mismatch in %s part %d. Decoded file probably corrupt." },
{ S_OUT_OF_MEMORY, (char *)"Out of memory allocating %d bytes" },
{ S_TARGET_EXISTS, (char *)"Target file %s exists and overwriting is not allowed" },
{ S_NOT_RENAME, (char *)"Could not change name of %s to %s" },
{ S_ERR_ENCODING, (char *)"Error while encoding %s: %s" },
{ S_STAT_ONE_PART, (char *)"Could not stat input, encoding to one part only" },
{ S_PARM_CHECK, (char *)"Parameter check failed in %s" },
{ S_SHORT_BINHEX, (char *)"BinHex encoded file %s ended prematurely (%ld bytes left)" },
{ S_DECODE_CANCEL, (char *)"Decode operation canceled" },
{ S_ENCODE_CANCEL, (char *)"Encode operation canceled" },
{ S_SCAN_CANCEL, (char *)"Scanning canceled" },
{ S_SIZE_MISMATCH, (char *)"%s: Decoded size (%ld) does not match expected size (%ld)" },
{ S_PSIZE_MISMATCH, (char *)"%s part %d: Decoded size (%ld) does not match expected size (%ld)" },
{ S_CRC_MISMATCH, (char *)"CRC32 mismatch in %s. Decoded file probably corrupt." },
{ S_PCRC_MISMATCH, (char *)"PCRC32 mismatch in %s part %d. Decoded file probably corrupt." },
/* informational messages */
{ S_LOADED_PART, "Loaded from %s: '%s' (%s): %s part %d %s %s %s" },
{ S_NO_DATA_FOUND, "No encoded data found in %s" },
{ S_NO_BIN_FILE, "Oops, could not find decoded file?" },
{ S_STRIPPED_SETUID, "Stripped setuid/setgid bits from target file %s mode %d" },
{ S_DATA_SUSPICIOUS, "Data looks suspicious. Decoded file might be corrupt." },
{ S_NO_TEMP_NAME, "Could not get name for temporary file" },
{ S_BINHEX_SIZES, "BinHex file: data/resource fork sizes %ld/%ld" },
{ S_BINHEX_BOTH, "BinHex file: both forks non-empty, decoding data fork" },
{ S_SMERGE_MERGED, "Parts of '%s' merged with parts of '%s' (%d)" },
{ S_LOADED_PART, (char *)"Loaded from %s: '%s' (%s): %s part %d %s %s %s" },
{ S_NO_DATA_FOUND, (char *)"No encoded data found in %s" },
{ S_NO_BIN_FILE, (char *)"Oops, could not find decoded file?" },
{ S_STRIPPED_SETUID, (char *)"Stripped setuid/setgid bits from target file %s mode %d" },
{ S_DATA_SUSPICIOUS, (char *)"Data looks suspicious. Decoded file might be corrupt." },
{ S_NO_TEMP_NAME, (char *)"Could not get name for temporary file" },
{ S_BINHEX_SIZES, (char *)"BinHex file: data/resource fork sizes %ld/%ld" },
{ S_BINHEX_BOTH, (char *)"BinHex file: both forks non-empty, decoding data fork" },
{ S_SMERGE_MERGED, (char *)"Parts of '%s' merged with parts of '%s' (%d)" },
/* MIME-related messages */
{ S_MIME_NO_BOUNDARY, "Multipart message without boundary ignored" },
{ S_MIME_B_NOT_FOUND, "Boundary expected on Multipart message but found EOF" },
{ S_MIME_MULTI_DEPTH, "Multipart message nested too deep" },
{ S_MIME_PART_MULTI, "Handling partial multipart message as plain text" },
{ S_MIME_NO_BOUNDARY, (char *)"Multipart message without boundary ignored" },
{ S_MIME_B_NOT_FOUND, (char *)"Boundary expected on Multipart message but found EOF" },
{ S_MIME_MULTI_DEPTH, (char *)"Multipart message nested too deep" },
{ S_MIME_PART_MULTI, (char *)"Handling partial multipart message as plain text" },
{ 0, "" }
{ 0, (char *)"" }
};
/*
@@ -115,16 +115,16 @@ static stringmap messages[] = {
*/
char *uuretcodes[] = {
"OK",
"File I/O Error",
"Not Enough Memory",
"Illegal Value",
"No Data found",
"Unexpected End of File",
"Unsupported function",
"File exists",
"Continue -- no error", /* only to be seen internally */
"Operation Canceled"
(char *)"OK",
(char *)"File I/O Error",
(char *)"Not Enough Memory",
(char *)"Illegal Value",
(char *)"No Data found",
(char *)"Unexpected End of File",
(char *)"Unsupported function",
(char *)"File exists",
(char *)"Continue -- no error", /* only to be seen internally */
(char *)"Operation Canceled"
};
/*
@@ -132,7 +132,7 @@ char *uuretcodes[] = {
*/
char *codenames[8] = {
"", "UUdata", "Base64", "XXdata", "Binhex", "Text", "Text", "yEnc"
(char *)"", (char *)"UUdata", (char *)"Base64", (char *)"XXdata", (char *)"Binhex", (char *)"Text", (char *)"Text", (char *)"yEnc"
};
/*
@@ -140,7 +140,7 @@ char *codenames[8] = {
*/
char *msgnames[6] = {
"", "Note: ", "Warning: ", "ERROR: ", "FATAL ERROR: ", "PANIC: "
(char *)"", (char *)"Note: ", (char *)"Warning: ", (char *)"ERROR: ", (char *)"FATAL ERROR: ", (char *)"PANIC: "
};
/*
@@ -151,7 +151,7 @@ char *msgnames[6] = {
char *
uustring (int codeno)
{
static char * faileddef = "oops";
static char * faileddef = (char *)"oops";
stringmap *ptr = messages;
while (ptr->code) {
@@ -161,7 +161,7 @@ uustring (int codeno)
}
UUMessage (uustring_id, __LINE__, UUMSG_ERROR,
"Could not retrieve string no %d",
(char *)"Could not retrieve string no %d",
codeno);
return faileddef;

View File

@@ -56,7 +56,7 @@
#include <fptools.h>
#include <uustring.h>
char * uuutil_id = "$Id$";
char * uuutil_id = (char *)"$Id$";
/*
* Parts with different known extensions will not be merged by SPMS.
@@ -64,10 +64,10 @@ char * uuutil_id = "$Id$";
*/
static char *knownexts[] = {
"mpg", "@mpeg", "avi", "mov",
"gif", "jpg", "@jpeg", "tif",
"voc", "wav", "@wave", "au",
"zip", "arj", "tar",
(char *)"mpg", (char *)"@mpeg", (char *)"avi", (char *)"mov",
(char *)"gif", (char *)"jpg", (char *)"@jpeg", (char *)"tif",
(char *)"voc", (char *)"wav", (char *)"@wave", (char *)"au",
(char *)"zip", (char *)"arj", (char *)"tar",
NULL
};