forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jpilot-mail-0.1.7.patch
172 lines (154 loc) · 5.27 KB
/
jpilot-mail-0.1.7.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
diff -Nru jpilot-Mail-0.1.7.orig/src/connect.c jpilot-Mail-0.1.7/src/connect.c
--- jpilot-Mail-0.1.7.orig/src/connect.c 2003-01-11 17:52:28.000000000 +0200
+++ jpilot-Mail-0.1.7/src/connect.c 2007-01-02 11:43:09.000000000 +0200
@@ -24,7 +24,7 @@
if(inet_aton(ip, &ia)){
mxip_addr mxip;
- mxip.name = g_strdup(ip);
+ mxip.name = (guchar*)g_strdup(ip);
mxip.pref = 0;
mxip.ip = (guint32) *(guint32 *)(&ia);
list = g_list_append(list, g_memdup(&mxip, sizeof(mxip)));
diff -Nru jpilot-Mail-0.1.7.orig/src/lookup.c jpilot-Mail-0.1.7/src/lookup.c
--- jpilot-Mail-0.1.7.orig/src/lookup.c 2002-06-27 21:36:26.000000000 +0300
+++ jpilot-Mail-0.1.7/src/lookup.c 2007-01-02 11:43:48.000000000 +0200
@@ -325,7 +325,7 @@
mxip_addr mxip;
mxip.ip = *(guint32 *)(haddr);
mxip.pref = 0;
- mxip.name = g_strdup(hent->h_name);
+ mxip.name = (guchar*)g_strdup(hent->h_name);
list = g_list_append(list, g_memdup(&mxip, sizeof(mxip)));
}
}
diff -Nru jpilot-Mail-0.1.7.orig/src/mail.c jpilot-Mail-0.1.7/src/mail.c
--- jpilot-Mail-0.1.7.orig/src/mail.c 2004-07-18 21:06:42.000000000 +0300
+++ jpilot-Mail-0.1.7/src/mail.c 2007-01-02 12:15:30.000000000 +0200
@@ -56,7 +56,7 @@
static int show_category = 0;
static int glob_row_selected;
-static struct MyMail *glob_mymail_list = NULL;
+struct MyMail *glob_mymail_list = NULL;
struct Preferences prefs;
struct MailSyncPref mailSyncPref;
@@ -75,6 +75,8 @@
*minor_version = 99;
}
+void multibyte_safe_strncpy(char *dst, char *src, size_t len);
+
static void free_mymail_list(struct MyMail **ppM)
{
struct MyMail *pM, *next_pM;
@@ -195,7 +197,7 @@
if (fptr)
{
gchar *line = NULL;
- gint line_size = 0;
+ size_t line_size = 0;
while (!feof(fptr))
{
@@ -1001,7 +1003,7 @@
if (size > 0)
{
- char *buf = g_malloc(size);
+ unsigned char *buf = g_malloc(size);
if (buf)
{
@@ -1030,7 +1032,7 @@
if (size > 0)
{
buf_rec br;
- char *buf = g_malloc(size);
+ unsigned char *buf = g_malloc(size);
if (buf)
{
@@ -1212,7 +1214,7 @@
temp_str = malloc((len = strlen(mai.category.name[i])*2+1));
multibyte_safe_strncpy(temp_str, mai.category.name[i], len);
- jp_charset_p2j(temp_str, len);
+ jp_charset_p2j((unsigned char *)temp_str, len);
categories[i] = temp_str;
}
categories[i] = NULL;
diff -Nru jpilot-Mail-0.1.7.orig/src/mail_get.c jpilot-Mail-0.1.7/src/mail_get.c
--- jpilot-Mail-0.1.7.orig/src/mail_get.c 2004-07-18 20:31:28.000000000 +0300
+++ jpilot-Mail-0.1.7/src/mail_get.c 2007-01-02 12:16:29.000000000 +0200
@@ -68,7 +68,7 @@
{
GList *id_list = NULL;
gchar *line = NULL;
- gint line_size = 0;
+ size_t line_size = 0;
while (!feof(fptr))
{
@@ -179,7 +179,7 @@
{
FILE *in;
char *line = NULL;
- gint line_size = 0;
+ size_t line_size = 0;
GList *id_list = read_msgids();
// conf.debug_level = 5;
diff -Nru jpilot-Mail-0.1.7.orig/src/mail_send.c jpilot-Mail-0.1.7/src/mail_send.c
--- jpilot-Mail-0.1.7.orig/src/mail_send.c 2004-04-29 20:27:48.000000000 +0300
+++ jpilot-Mail-0.1.7/src/mail_send.c 2007-01-02 12:16:58.000000000 +0200
@@ -233,7 +233,7 @@
if (pMail->mail.body != NULL)
{
- guchar *p = pMail->mail.body;
+ gchar *p = pMail->mail.body;
while (*p)
{
diff -Nru jpilot-Mail-0.1.7.orig/src/mbox.c jpilot-Mail-0.1.7/src/mbox.c
--- jpilot-Mail-0.1.7.orig/src/mbox.c 2004-04-17 19:24:15.000000000 +0300
+++ jpilot-Mail-0.1.7/src/mbox.c 2007-01-02 11:49:55.000000000 +0200
@@ -25,7 +25,8 @@
gboolean mbox_read(message * msg, FILE * in, gchar ** from_line, int max_size)
{
gchar *line = NULL;
- gint line_size = 0, line_cnt = 0;
+// gint line_size = 0, line_cnt = 0;
+ size_t line_size = 0;
gint data_size = 0;
gboolean in_headers = TRUE;
int l_no = 1;
@@ -91,7 +92,7 @@
msg->data_list = g_list_append(msg->data_list, g_strdup(line));
data_size += strlen(line);
}
- line_cnt++;
+// line_cnt++;
}
}
diff -Nru jpilot-Mail-0.1.7.orig/src/smtp_out.c jpilot-Mail-0.1.7/src/smtp_out.c
--- jpilot-Mail-0.1.7.orig/src/smtp_out.c 2003-01-11 17:52:28.000000000 +0200
+++ jpilot-Mail-0.1.7/src/smtp_out.c 2007-01-02 12:11:27.000000000 +0200
@@ -66,7 +66,7 @@
gchar *set_heloname(smtp_base *psb, gchar *default_name, gboolean do_correct)
{
struct sockaddr_in sname;
- int len = sizeof(struct sockaddr_in);
+ socklen_t len = sizeof(struct sockaddr_in);
struct hostent *host_entry;
if(do_correct){
@@ -479,11 +479,11 @@
if((addr = connect_resolvelist(&sock, host, port, resolve_list))){
/* create structure to hold status data: */
psb = create_smtpbase(sock);
- psb->remote_host = addr->name;
+ psb->remote_host = (gchar*)addr->name;
DEBUG(5){
struct sockaddr_in name;
- int len = sizeof(struct sockaddr);
+ socklen_t len = sizeof(struct sockaddr);
getsockname(sock, (struct sockaddr *)(&name), &len);
debugf("socket: name.sin_addr = %s\n", inet_ntoa(name.sin_addr));
}
diff -Nru jpilot-Mail-0.1.7.orig/src/utils.h jpilot-Mail-0.1.7/src/utils.h
--- jpilot-Mail-0.1.7.orig/src/utils.h 2002-06-27 21:36:26.000000000 +0300
+++ jpilot-Mail-0.1.7/src/utils.h 2007-01-02 11:28:45.000000000 +0200
@@ -21,4 +21,6 @@
int get_home_file_name(char *file, char *full_name, int max_size);
+extern void multibyte_safe_strncpy(char *dst, char *src, size_t len);
+
#endif