From: Robert Luberda <robert@debian.org>
Date: Sun, 3 May 2020 12:49:21 +0200
Subject: Fix FTBFS with gcc-10

Bugs-Debian: https://bugs.debian.org/957958
---
 src/options.c   |  2 ++
 src/options.h   |  4 +++-
 src/wmgeneral.h |  4 ++--
 src/wmxmms2.c   |  1 +
 src/xmms2cif.c  | 10 ++++++++--
 src/xmms2cif.h  |  8 ++++----
 6 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/options.c b/src/options.c
index 5edbac7..143bd1b 100644
--- a/src/options.c
+++ b/src/options.c
@@ -12,6 +12,8 @@
 #include <stdlib.h>
 #include "options.h"
 
+struct varList varoptions;
+
 void incompatArg(int *index, int c, char *optarg);
 void showoption(const char *str , char *option);
 void showHelp(void);
diff --git a/src/options.h b/src/options.h
index 9b7ce36..e08bf27 100644
--- a/src/options.h
+++ b/src/options.h
@@ -13,7 +13,9 @@ struct varList{
 	unsigned int speed;
 	char *colour;
 	char *ip_address;
-} varoptions;
+};
+
+extern struct varList varoptions;
 
 void optionHandler(int argc, char **argv);
 #endif
diff --git a/src/wmgeneral.h b/src/wmgeneral.h
index ebd1a5f..fce6bde 100644
--- a/src/wmgeneral.h
+++ b/src/wmgeneral.h
@@ -48,8 +48,8 @@ typedef struct {
 } XpmIcon;
 
 
-Display		*display;
-Window          Root, iconwin, win;
+extern Display		*display;
+extern Window          Root, iconwin, win;
 
 
 void AddMouseRegion(int index, int left, int top, int right, int bottom);
diff --git a/src/wmxmms2.c b/src/wmxmms2.c
index 644b051..91b797f 100644
--- a/src/wmxmms2.c
+++ b/src/wmxmms2.c
@@ -31,6 +31,7 @@ static int mask_width = 64;
 static int mask_height = 64;
 
 Display *display;
+Window Root, iconwin, win;
 XEvent Event;
 
 void runningLoop(void);
diff --git a/src/xmms2cif.c b/src/xmms2cif.c
index 66804af..396a88c 100644
--- a/src/xmms2cif.c
+++ b/src/xmms2cif.c
@@ -12,6 +12,12 @@
 #include "options.h"
 #include <xmmsc/xmmsv.h>
 #include "malloc.h"
+
+volatile unsigned int STATE;
+numberinfo numinfo;
+char songname[100];
+xmmsc_connection_t *srvr;
+
 static uint have_songname;
 uint songlength;
 
@@ -226,7 +232,7 @@ void title_info(void){
 		*numinfo.title_info = 0;
 		if (xmmsv_dict_get (infos, "artist", &dict_entry) &&
 		    xmmsv_get_string (dict_entry, &artist)) {
-			strncpy(numinfo.title_info, artist, sizeof(numinfo.title_info));
+			strncpy(numinfo.title_info, artist, sizeof(numinfo.title_info) - 1);
 		}
 		if (xmmsv_dict_get (infos, "title", &dict_entry) &&
 		    xmmsv_get_string (dict_entry, &title)) {
@@ -240,7 +246,7 @@ void title_info(void){
 			/* Taking a risk at segfault here ;-) */
 			if ((filename=basename((char*)url))!=NULL) {
 				strncpy(numinfo.title_info,filename,
-					sizeof(numinfo.title_info));
+					sizeof(numinfo.title_info) - 1);
 			}
 		}
 
diff --git a/src/xmms2cif.h b/src/xmms2cif.h
index e6d8569..53302b5 100644
--- a/src/xmms2cif.h
+++ b/src/xmms2cif.h
@@ -11,7 +11,7 @@
 #define __XMMS2CIF_H__
 #include <xmmsclient/xmmsclient.h>
 #include <string.h>
-volatile unsigned int STATE;
+extern volatile unsigned int STATE;
 #define S_IDLE  0
 #define S_PLAY  1
 #define S_PAUSE 2
@@ -24,9 +24,9 @@ struct numberinfo {
 	char title_info[100];
 };
 typedef struct numberinfo numberinfo;
-numberinfo numinfo;
+extern numberinfo numinfo;
 
-char songname[100];
+extern char songname[100];
 
 void xmms2connect (void);
 void play_cmd(void);
@@ -48,6 +48,6 @@ void timelaps(int delta);
 /*void media_info(void);*/
 
 
-xmmsc_connection_t *srvr;
+extern xmmsc_connection_t *srvr;
 
 #endif
