aboutsummaryrefslogtreecommitdiff
path: root/games/tetrinet/patches/compilefix.diff
blob: 868e55aa3b0ffedb392cafe490796a80512f0c08 (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
diff -Naur tetrinet-0.11/server.c tetrinet-0.11.patched/server.c
--- tetrinet-0.11/server.c	2003-09-07 12:29:29.000000000 -0400
+++ tetrinet-0.11.patched/server.c	2020-11-20 22:06:44.851665337 -0500
@@ -839,7 +839,7 @@
 
     if (listen_sock >= 0 && FD_ISSET(listen_sock, &fds)) {
 	struct sockaddr_in sin;
-	int len = sizeof(sin);
+	socklen_t len = sizeof(sin);
 	fd = accept(listen_sock, (struct sockaddr *)&sin, &len);
 	if (fd >= 0) {
 	    for (i = 0; i < 6 && player_socks[i] != -1; i++)
@@ -857,7 +857,7 @@
 #ifdef HAVE_IPV6
     if (listen_sock6 >= 0 && FD_ISSET(listen_sock6, &fds)) {
 	struct sockaddr_in6 sin6;
-	int len = sizeof(sin6);
+	socklen_t len = sizeof(sin6);
 	fd = accept(listen_sock6, (struct sockaddr *)&sin6, &len);
 	if (fd >= 0) {
 	    for (i = 0; i < 6 && player_socks[i] != -1; i++)
diff -Naur tetrinet-0.11/sockets.c tetrinet-0.11.patched/sockets.c
--- tetrinet-0.11/sockets.c	2003-09-09 15:15:04.000000000 -0400
+++ tetrinet-0.11.patched/sockets.c	2020-11-20 22:06:44.852665337 -0500
@@ -66,7 +66,7 @@
     if (c == 0xFF)
 	ptr--;
     *ptr = 0;
-    if (log) {
+    if (logging) {
 	if (!logfile)
 	    logfile = fopen(logname, "a");
 	if (logfile) {
@@ -89,7 +89,7 @@
     unsigned char c = 0xFF;
     int n = 0;
 
-    if (log) {
+    if (logging) {
 	if (!logfile)
 	    logfile = fopen(logname, "a");
 	if (logfile) {
diff -Naur tetrinet-0.11/tetrinet.c tetrinet-0.11.patched/tetrinet.c
--- tetrinet-0.11/tetrinet.c	2003-09-07 12:29:29.000000000 -0400
+++ tetrinet-0.11.patched/tetrinet.c	2020-11-20 22:09:01.677652899 -0500
@@ -21,7 +21,7 @@
 /*************************************************************************/
 
 int fancy = 0;		/* Fancy TTY graphics? */
-int log = 0;		/* Log network traffic to file? */
+int logging = 0;		/* Log network traffic to file? */
 char *logname;		/* Log filename */
 int windows_mode = 0;	/* Try to be just like the Windows version? */
 int noslide = 0;	/* Disallow piece sliding? */
@@ -83,7 +83,7 @@
 		winlist[i].team = 0;
 	    s++;
 	    strncpy(winlist[i].name, s, sizeof(winlist[i].name)-1);
-	    winlist[i].name[sizeof(winlist[i].name)] = 0;
+	    winlist[i].name[sizeof(winlist[i].name)-1] = 0;
 	    winlist[i].points = atoi(t);
 	    if ((t = strchr(t, ';')) != NULL)
 		winlist[i].games = atoi(t+1);
@@ -560,7 +560,7 @@
     char *nick = NULL, *server = NULL;
     char buf[1024];
     char nickmsg[1024];
-    unsigned char ip[4];
+    char ip[4];
     char iphashbuf[32];
     int len;
 #ifdef BUILTIN_SERVER
@@ -590,7 +590,7 @@
 	    if (strcmp(av[i], "-fancy") == 0) {
 		fancy = 1;
 	    } else if (strcmp(av[i], "-log") == 0) {
-		log = 1;
+		logging = 1;
 		i++;
 		if (i >= ac) {
 		    fprintf(stderr, "Option -log requires an argument\n");
diff -Naur tetrinet-0.11/tetrinet.h tetrinet-0.11.patched/tetrinet.h
--- tetrinet-0.11/tetrinet.h	2003-09-07 12:12:51.000000000 -0400
+++ tetrinet-0.11.patched/tetrinet.h	2020-11-20 22:06:44.852665337 -0500
@@ -74,7 +74,7 @@
 /* Externs */
 
 extern int fancy;
-extern int log;
+extern int logging;
 extern char *logname;
 extern int windows_mode;
 extern int noslide;