Path: blob/main/korean/hcode/files/patch-mail.c
16149 views
--- mail.c.orig 1998-03-11 05:02:22.000000000 -05001+++ mail.c 2013-06-12 20:06:21.000000000 -04002@@ -1,4 +1,8 @@3+#include <ctype.h>4#include <stdio.h>5+#include <string.h>6+7+static int ks2iso(unsigned char *, FILE *);89/* ------------------------------------------------------10Search for Starting Mark and print out (ENGLISH) prologue11@@ -66,9 +70,8 @@12#define SI '\017'13#define SO '\016'1415-int ks2iso(ibuf,fpout)16-unsigned char *ibuf;17-FILE *fpout;18+static int19+ks2iso(unsigned char *ibuf, FILE *fpout)20{21int mode=ASCII;22int i=0;23@@ -172,8 +175,8 @@24if (fgets((char *) ibuf,HDR_BUF_LEN,fpin) == NULL) /* no message body */25return(1); /* header only (6/8/96) */2627- if ( ! strncasecmp("Content-Type:",iptr,13) ||28- !strncasecmp("Content-Transfer-Encoding:",iptr,26) ) {29+ if ( ! strncasecmp("Content-Type:", (char *)iptr, 13) ||30+ !strncasecmp("Content-Transfer-Encoding:", (char *)iptr, 26) ) {31header_switch(iptr,fpout);32continue;33}34@@ -186,7 +189,7 @@35while ( charset[++i] != NULL ) {3637sprintf(encode_prefix,"=?%s?B?",charset[i]);38- if ( ! strncasecmp(encode_prefix,iptr,39+ if ( ! strncasecmp(encode_prefix, (char *)iptr,40strlen(encode_prefix)) ) {41isbqheader=42bqheader_decode(&iptr,encode_prefix,Bencode,43@@ -195,7 +198,7 @@44}4546sprintf(encode_prefix,"=?%s?Q?",charset[i]);47- if ( ! strncasecmp(encode_prefix,iptr,48+ if ( ! strncasecmp(encode_prefix, (char *)iptr,49strlen(encode_prefix)) ) {50isbqheader=51bqheader_decode(&iptr,encode_prefix,Qencode,52@@ -250,15 +253,15 @@53return;54}55ibuf[cp++] = '\n';56- ibuf[cp] = NULL;57+ ibuf[cp] = '\0';58cp = 0;59iptr = ibuf;60while (*iptr) {61tptr = tbuf;62while (*iptr && *iptr<0x80) fputc(*iptr++,fpout);63while (*iptr && (*iptr>0x80 || *iptr ==' ')) *tptr++ = *iptr++;64- *tptr = NULL;65- if (tbuf[0]!=NULL) {66+ *tptr = '\0';67+ if (tbuf[0]!='\0') {68string_to_base64(obuf, tbuf);69fprintf(fpout,"=?EUC-KR?B?%s?=",obuf);70}71@@ -342,12 +345,12 @@72only checks if there's any whitespace or '?'.73*/7475- while ( *iptr && strncmp("?=",iptr,2) && tptr-tbuf < BQ_BUF_SIZE - 2 ) {76+ while ( *iptr && strncmp("?=", (char *)iptr, 2) && tptr-tbuf < BQ_BUF_SIZE - 2 ) {77if ( isspace(*iptr) || *iptr == '?' ) break;78*tptr++ = *iptr++;79}80- *tptr = NULL;81- if ( ! strncmp("?=",iptr,2) ) {82+ *tptr = '\0';83+ if ( ! strncmp("?=", (char *)iptr, 2) ) {84iptr+=2;85if ( encoding == Bencode)86base64_to_string(obuf, tbuf);87@@ -495,7 +498,7 @@88/* void header_switch(iptr0,fpout,name_len) */89void header_switch(iptr,fpout)90/* unsigned char **iptr0; */91-unsigned char *iptr;92+char *iptr;93FILE *fpout;94/* int name_len; */95{969798