Split a trigraph sequence in a string constant.
[u/mdw/putty] / telnet.c
index 1f1a89e..f20488e 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -1,4 +1,3 @@
-#include <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -227,9 +226,14 @@ static void c_write1(Telnet telnet, int c)
 static void log_option(Telnet telnet, char *sender, int cmd, int option)
 {
     char buf[50];
+    /*
+     * The strange-looking "<?""?>" below is there to avoid a
+     * trigraph - a double question mark followed by > maps to a
+     * closing brace character!
+     */
     sprintf(buf, "%s:\t%s %s", sender,
            (cmd == WILL ? "WILL" : cmd == WONT ? "WONT" :
-            cmd == DO ? "DO" : cmd == DONT ? "DONT" : "<??>"),
+            cmd == DO ? "DO" : cmd == DONT ? "DONT" : "<?""?>"),
            telopt(option));
     logevent(telnet->frontend, buf);
 }
@@ -890,7 +894,7 @@ static Socket telnet_socket(void *handle)
 
 static int telnet_sendok(void *handle)
 {
-    Telnet telnet = (Telnet) handle;
+    /* Telnet telnet = (Telnet) handle; */
     return 1;
 }
 
@@ -923,7 +927,7 @@ static void telnet_provide_logctx(void *handle, void *logctx)
 
 static int telnet_exitcode(void *handle)
 {
-    Telnet telnet = (Telnet) handle;
+    /* Telnet telnet = (Telnet) handle; */
     /* Telnet doesn't transmit exit codes back to the client */
     return 0;
 }