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