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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
--- src/libtcp-portmon.c.old 2005-12-05 22:27:16.000000000 -0500
+++ src/libtcp-portmon.c 2006-02-13 00:22:25.000000000 -0500
@@ -3,7 +3,7 @@
*
* Copyright (C) 2005 Philip Kovacs kovacsp3@comcast.net
*
- * $Id: portmon-mpd.patch,v 1.1 2006/02/18 22:50:36 dragonheart Exp $
+ * $Id: portmon-mpd.patch,v 1.1 2006/02/18 22:50:36 dragonheart Exp $
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -231,8 +231,8 @@
p_monitor1 = (tcp_port_monitor_t *)p_data1;
p_monitor2 = (tcp_port_monitor_t *)p_data2;
- return (p_monitor1->port_range_begin == p_monitor1->port_range_begin &&
- p_monitor2->port_range_end == p_monitor2->port_range_end);
+ return (p_monitor1->port_range_begin == p_monitor2->port_range_begin &&
+ p_monitor1->port_range_end == p_monitor2->port_range_end);
}
/* ---------------------------------------------------------------------------
--- src/mpd.c.old 2006-02-12 23:11:15.000000000 -0500
+++ src/mpd.c 2006-02-14 13:23:14.000000000 -0500
@@ -42,22 +42,14 @@
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
if (current_info->mpd.file == NULL)
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
- strncpy(current_info->mpd.name, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.file, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.artist, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.album, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.title, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.random, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.repeat, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.track, "Unknown",
- TEXT_BUFFER_SIZE - 1);
+ *current_info->mpd.name=0;
+ *current_info->mpd.file=0;
+ *current_info->mpd.artist=0;
+ *current_info->mpd.album=0;
+ *current_info->mpd.title=0;
+ *current_info->mpd.random=0;
+ *current_info->mpd.repeat=0;
+ *current_info->mpd.track=0;
strncpy(current_info->mpd.status, "MPD not responding", TEXT_BUFFER_SIZE - 1);
current_info->mpd.bitrate = 0;
current_info->mpd.progress = 0;
@@ -97,22 +89,14 @@
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
if (current_info->mpd.file == NULL)
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
- strncpy(current_info->mpd.name, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.file, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.artist, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.album, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.title, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.random, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.repeat, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.track, "Unknown",
- TEXT_BUFFER_SIZE - 1);
+ *current_info->mpd.name=0;
+ *current_info->mpd.file=0;
+ *current_info->mpd.artist=0;
+ *current_info->mpd.album=0;
+ *current_info->mpd.title=0;
+ *current_info->mpd.random=0;
+ *current_info->mpd.repeat=0;
+ *current_info->mpd.track=0;
strncpy(current_info->mpd.status, "MPD not responding", TEXT_BUFFER_SIZE - 1);
current_info->mpd.bitrate = 0;
current_info->mpd.progress = 0;
@@ -158,23 +142,15 @@
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
if (current_info->mpd.file == NULL)
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
- strncpy(current_info->mpd.name, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.file, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.artist, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.album, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.title, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.random, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.repeat, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.track, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.status, "Unknown",
+ *current_info->mpd.name=0;
+ *current_info->mpd.file=0;
+ *current_info->mpd.artist=0;
+ *current_info->mpd.album=0;
+ *current_info->mpd.title=0;
+ *current_info->mpd.random=0;
+ *current_info->mpd.repeat=0;
+ *current_info->mpd.track=0;
+ strncpy(current_info->mpd.status, "Stopped",
TEXT_BUFFER_SIZE - 1);
}
if (status->state == MPD_STATUS_STATE_PAUSE) {
@@ -211,24 +187,15 @@
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
if (current_info->mpd.file == NULL)
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
- strncpy(current_info->mpd.name, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.file, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.artist, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.album, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.title, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.random, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.repeat, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.track, "Unknown",
- TEXT_BUFFER_SIZE - 1);
- strncpy(current_info->mpd.status, "Unknown",
- TEXT_BUFFER_SIZE - 1);
+ *current_info->mpd.name=0;
+ *current_info->mpd.file=0;
+ *current_info->mpd.artist=0;
+ *current_info->mpd.album=0;
+ *current_info->mpd.title=0;
+ *current_info->mpd.random=0;
+ *current_info->mpd.repeat=0;
+ *current_info->mpd.track=0;
+ *current_info->mpd.status=0;
}
if (status->state == MPD_STATUS_STATE_PLAY ||
status->state == MPD_STATUS_STATE_PAUSE) {
@@ -248,14 +215,14 @@
} else if (status->random == 1) {
strcpy(current_info->mpd.random, "On");
} else {
- strcpy(current_info->mpd.random, "Unknown");
+ *current_info->mpd.random=0;
}
if (status->repeat == 0) {
strcpy(current_info->mpd.repeat, "Off");
} else if (status->repeat == 1) {
strcpy(current_info->mpd.repeat, "On");
} else {
- strcpy(current_info->mpd.repeat, "Unknown");
+ *current_info->mpd.repeat=0;
}
}
@@ -292,37 +259,37 @@
strncpy(current_info->mpd.artist, song->artist,
TEXT_BUFFER_SIZE - 1);
} else {
- strcpy(current_info->mpd.artist, "Unknown");
+ *current_info->mpd.artist=0;
}
if (song->album) {
strncpy(current_info->mpd.album, song->album,
TEXT_BUFFER_SIZE - 1);
} else {
- strcpy(current_info->mpd.album, "Unknown");
+ *current_info->mpd.album=0;
}
if (song->title) {
strncpy(current_info->mpd.title, song->title,
TEXT_BUFFER_SIZE - 1);
} else {
- strcpy(current_info->mpd.title, "Unknown");
+ *current_info->mpd.title=0;
}
if (song->track) {
strncpy(current_info->mpd.track, song->track,
TEXT_BUFFER_SIZE - 1);
} else {
- strcpy(current_info->mpd.track, "Unknown");
+ *current_info->mpd.track=0;
}
if (song->name) {
strncpy(current_info->mpd.name, song->name,
TEXT_BUFFER_SIZE - 1);
} else {
- strcpy(current_info->mpd.name, "Unknown");
+ *current_info->mpd.name=0;
}
if (song->file) {
strncpy(current_info->mpd.file,
song->file, TEXT_BUFFER_SIZE - 1);
} else {
- strcpy(current_info->mpd.file, "Unknown");
+ *current_info->mpd.file=0;
}
if (entity != NULL) {
mpd_freeInfoEntity(entity);
|