Blame SOURCES/netkit-telnet-0.17-gcc7.patch

3521ef
diff --git a/telnet/utilities.c b/telnet/utilities.c
3521ef
index 0bb0eab..d89ca37 100644
3521ef
--- a/telnet/utilities.c
3521ef
+++ b/telnet/utilities.c
3521ef
@@ -748,6 +748,7 @@ printsub(char direction, unsigned char *pointer, int length)
3521ef
 	    env_common:
3521ef
 		{
3521ef
 		    register int noquote = 2;
3521ef
+		    char* msg;
3521ef
 #if defined(ENV_HACK) && defined(OLD_ENVIRON)
3521ef
 		    extern int old_env_var, old_env_value;
3521ef
 #endif
3521ef
@@ -758,14 +759,24 @@ printsub(char direction, unsigned char *pointer, int length)
3521ef
 		     /*	case NEW_ENV_OVAR: */
3521ef
 			    if (pointer[0] == TELOPT_OLD_ENVIRON) {
3521ef
 # ifdef	ENV_HACK
3521ef
-				if (old_env_var == OLD_ENV_VALUE)
3521ef
-				    fprintf(NetTrace, "\" (VALUE) " + noquote);
3521ef
-				else
3521ef
+				if (old_env_var == OLD_ENV_VALUE) {
3521ef
+				    msg = "\" (VALUE) ";
3521ef
+				    fprintf(NetTrace, "%s", msg + noquote);
3521ef
+				}
3521ef
+				else {
3521ef
 # endif
3521ef
-				    fprintf(NetTrace, "\" VAR " + noquote);
3521ef
+				    msg = "\" VAR ";
3521ef
+				    fprintf(NetTrace, "%s", msg + noquote);
3521ef
+# ifdef ENV_HACK
3521ef
+				}
3521ef
+#endif /*ENV_HACK*/
3521ef
 			    } else
3521ef
 #endif /* OLD_ENVIRON */
3521ef
-				fprintf(NetTrace, "\" VALUE " + noquote);
3521ef
+				msg = "\" VALUE ";
3521ef
+				fprintf(NetTrace, "%s", msg + noquote);
3521ef
+#ifdef OLD_ENVIRON
3521ef
+			    }
3521ef
+#endif /* OLD_ENVIRON */
3521ef
 			    noquote = 2;
3521ef
 			    break;
3521ef
 
3521ef
@@ -774,24 +785,36 @@ printsub(char direction, unsigned char *pointer, int length)
3521ef
 		     /* case OLD_ENV_VALUE: */
3521ef
 			    if (pointer[0] == TELOPT_OLD_ENVIRON) {
3521ef
 # ifdef	ENV_HACK
3521ef
-				if (old_env_value == OLD_ENV_VAR)
3521ef
-				    fprintf(NetTrace, "\" (VAR) " + noquote);
3521ef
-				else
3521ef
+				if (old_env_value == OLD_ENV_VAR) {
3521ef
+				    msg = "\" (VAR) ";
3521ef
+				    fprintf(NetTrace, "%s", msg + noquote);
3521ef
+				}
3521ef
+				else {
3521ef
 # endif
3521ef
-				    fprintf(NetTrace, "\" VALUE " + noquote);
3521ef
-			    } else
3521ef
+				    msg = "\" VALUE ";
3521ef
+				    fprintf(NetTrace, "%s", msg + noquote);
3521ef
+# ifdef ENV_HACK
3521ef
+				}
3521ef
+# endif
3521ef
+			    } else {
3521ef
 #endif /* OLD_ENVIRON */
3521ef
-				fprintf(NetTrace, "\" VAR " + noquote);
3521ef
+				msg = "\" VAR ";
3521ef
+				fprintf(NetTrace, "%s", msg + noquote);
3521ef
+#ifdef OLD_ENVIRON
3521ef
+			    }
3521ef
+#endif
3521ef
 			    noquote = 2;
3521ef
 			    break;
3521ef
 
3521ef
 			case ENV_ESC:
3521ef
-			    fprintf(NetTrace, "\" ESC " + noquote);
3521ef
+			    msg = "\" ESC ";
3521ef
+			    fprintf(NetTrace, "%s", msg + noquote);
3521ef
 			    noquote = 2;
3521ef
 			    break;
3521ef
 
3521ef
 			case ENV_USERVAR:
3521ef
-			    fprintf(NetTrace, "\" USERVAR " + noquote);
3521ef
+			    msg = "\" USERVAR ";
3521ef
+			    fprintf(NetTrace, "%s", msg + noquote);
3521ef
 			    noquote = 2;
3521ef
 			    break;
3521ef
 
3521ef
diff --git a/telnetd/utility.c b/telnetd/utility.c
3521ef
index 4a438be..82edee5 100644
3521ef
--- a/telnetd/utility.c
3521ef
+++ b/telnetd/utility.c
3521ef
@@ -969,22 +969,26 @@ printsub(char direction, unsigned char *pointer, int length)
3521ef
 	    env_common:
3521ef
 		{
3521ef
 		    register int noquote = 2;
3521ef
+		    char* msg;
3521ef
 		    for (i = 2; i < length; i++ ) {
3521ef
 			switch (pointer[i]) {
3521ef
 			case ENV_VAR:
3521ef
 			    if (pointer[1] == TELQUAL_SEND)
3521ef
 				goto def_case;
3521ef
-			    netoprintf("\" VAR " + noquote);
3521ef
+			    msg = "\" VAR ";
3521ef
+			    netoprintf("%s", msg + noquote);
3521ef
 			    noquote = 2;
3521ef
 			    break;
3521ef
 
3521ef
 			case ENV_VALUE:
3521ef
-			    netoprintf("\" VALUE " + noquote);
3521ef
+			    msg = "\" VALUE ";
3521ef
+			    netoprintf("%s", msg + noquote);
3521ef
 			    noquote = 2;
3521ef
 			    break;
3521ef
 
3521ef
 			case ENV_ESC:
3521ef
-			    netoprintf("\" ESC " + noquote);
3521ef
+			    msg = "\" ESC ";
3521ef
+			    netoprintf("%s", msg + noquote);
3521ef
 			    noquote = 2;
3521ef
 			    break;
3521ef