summaryrefslogtreecommitdiff
path: root/multimedia/xine-ui/patches/patch-ai
blob: 5ecf6aa276fa7b413274a6362ffbb225661787ac (plain)
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
$NetBSD: patch-ai,v 1.2 2007/02/17 22:48:16 salo Exp $

--- src/xitk/xine-remote.c.orig	2005-07-16 21:05:32.000000000 +0200
+++ src/xitk/xine-remote.c	2007-02-17 22:24:26.000000000 +0100
@@ -30,6 +30,7 @@
 #endif
 /* required for strncasecmp() */
 #define _BSD_SOURCE 1
+#define _NETBSD_SOURCE
 /* required to enable POSIX variant of getpwuid_r on solaris */
 #define _POSIX_PTHREAD_SEMANTICS 1
 
@@ -58,7 +59,7 @@
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/signal.h>
+#include <signal.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -66,8 +67,8 @@
 #include <netdb.h>
 #include <pthread.h>
 
-#include <readline.h>
-#include <history.h>
+#include <readline/readline.h>
+#include <readline/history.h>
 
 #include "common.h"
 
@@ -638,7 +639,7 @@ static int write_to_console(session_t *s
   va_end(args);
   
   pthread_mutex_lock(&session->console_mutex);
-  err = write_to_console_unlocked(session, buf);
+  err = write_to_console_unlocked(session, "%s", buf);
   pthread_mutex_unlock(&session->console_mutex);
 
   return err;
@@ -998,7 +999,7 @@ static void *select_thread(void *data) {
 		  write_to_console_unlocked_nocr(session, "\b \b");
 		  pos--;
 		}
-		write_to_console_unlocked(session, obuffer);
+		write_to_console_unlocked(session, "%s", obuffer);
 
 		rl_crlf();
 		rl_forced_update_display();
@@ -1082,7 +1083,7 @@ static void client_handle_command(sessio
 	  
 	  *pp = '\0';
 	  
-	  if((sock_write(session->socket, buf)) == -1) {
+	  if((sock_write(session->socket, "%s", buf)) == -1) {
 	    session->running = 0;
 	  }
 	}
@@ -1094,7 +1095,7 @@ static void client_handle_command(sessio
   
   /* Perhaps a ';' separated commands, so send anyway to server */
   if(found == 0) {
-    sock_write(session->socket, (char *)command);
+    sock_write(session->socket, "%s", (char *)command);
   }
   
   if((!strncasecmp(cmd, "exit", strlen(cmd))) || (!strncasecmp(cmd, "halt", strlen(cmd)))) {
@@ -1714,7 +1715,7 @@ static void do_commands(commands_t *cmd,
     i++;
   }
   sprintf(buf, "%s.\n", buf);
-  sock_write(client_info->socket, buf);
+  sock_write(client_info->socket, "%s", buf);
 }
 
 static void do_help(commands_t *cmd, client_info_t *client_info) {
@@ -1760,7 +1761,7 @@ static void do_help(commands_t *cmd, cli
     }
     
     sprintf(buf, "%s\n", buf);
-    sock_write(client_info->socket, buf);
+    sock_write(client_info->socket, "%s", buf);
   }
   else {
     int i;
@@ -2096,7 +2097,7 @@ static void do_get(commands_t *cmd, clie
 	  sprintf(buf, "%s%s", buf, "*UNKNOWN*");
 	
 	sprintf(buf, "%s%c", buf, '\n');
-	sock_write(client_info->socket, buf);
+	sock_write(client_info->socket, "%s", buf);
       }
       else if(is_arg_contain(client_info, 1, "speed")) {
 	char buf[64];
@@ -2116,7 +2117,7 @@ static void do_get(commands_t *cmd, clie
 	  sprintf(buf, "%s%s", buf, "*UNKNOWN*");
 	
 	sprintf(buf, "%s%c", buf, '\n');
-	sock_write(client_info->socket, buf);
+	sock_write(client_info->socket, "%s", buf);
       }
       else if(is_arg_contain(client_info, 1, "position")) {
 	char buf[64];
@@ -2128,7 +2129,7 @@ static void do_get(commands_t *cmd, clie
 			    &pos_time,
 			    &length_time);
 	snprintf(buf, sizeof(buf), "%s: %d\n", "Current position", pos_time);
-	sock_write(client_info->socket, buf);
+	sock_write(client_info->socket, "%s", buf);
       }
       else if(is_arg_contain(client_info, 1, "length")) {
 	char buf[64];
@@ -2140,7 +2141,7 @@ static void do_get(commands_t *cmd, clie
 			    &pos_time,
 			    &length_time);
 	snprintf(buf, sizeof(buf), "%s: %d\n", "Current length", length_time);
-	sock_write(client_info->socket, buf);
+	sock_write(client_info->socket, "%s", buf);
       }
       else if(is_arg_contain(client_info, 1, "loop")) {
 	char buf[64];
@@ -2169,7 +2170,7 @@ static void do_get(commands_t *cmd, clie
 	}
 
 	sprintf(buf, "%s.\n", buf);
-	sock_write(client_info->socket, buf);
+	sock_write(client_info->socket, "%s", buf);
       }
     }
     else if(nargs >= 2) {
@@ -2552,7 +2553,7 @@ static void do_halt(commands_t *cmd, cli
 static void network_messenger(void *data, char *message) {
   int socket = (int) data;
   
-  sock_write(socket, message);
+  sock_write(socket, "%s", message);
 }
 
 static void do_snap(commands_t *cmd, client_info_t *client_info) {
@@ -2577,7 +2578,7 @@ static void say_hello(client_info_t *cli
   else {
     snprintf(buf, sizeof(buf), "%s %s %s\n", PACKAGE, VERSION, "remote server. Nice to meet you.");
   }
-  sock_write(client_info->socket, buf);
+  sock_write(client_info->socket, "%s", buf);
   
 }