]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - telnet.c
Giant const-correctness patch of doom!
[PuTTY.git] / telnet.c
index 8717a9723d3689c3dd9a97304c6b9b3cdbdc09f4..ca1665258c61429384135c619aa7c6989f270d91 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -113,7 +113,7 @@ enum { TELOPTS(telnet_enum) dummy=0 };
        ( (x) != IAC && \
              (telnet->opt_states[o_we_bin.index] == ACTIVE || (x) != CR))
 
-static char *telopt(int opt)
+static const char *telopt(int opt)
 {
 #define telnet_str(x,y) case TELOPT_##x: return #x;
     switch (opt) {
@@ -212,14 +212,14 @@ typedef struct telnet_tag {
 
 #define SB_DELTA 1024
 
-static void c_write(Telnet telnet, char *buf, int len)
+static void c_write(Telnet telnet, const char *buf, int len)
 {
     int backlog;
     backlog = from_backend(telnet->frontend, 0, buf, len);
     sk_set_frozen(telnet->s, backlog > TELNET_MAX_BACKLOG);
 }
 
-static void log_option(Telnet telnet, char *sender, int cmd, int option)
+static void log_option(Telnet telnet, const char *sender, int cmd, int option)
 {
     char *buf;
     /*
@@ -715,7 +715,7 @@ static void telnet_sent(Plug plug, int bufsize)
  * freed by the caller.
  */
 static const char *telnet_init(void *frontend_handle, void **backend_handle,
-                              Conf *conf, char *host, int port,
+                              Conf *conf, const char *host, int port,
                               char **realhost, int nodelay, int keepalive)
 {
     static const struct plug_function_table fn_table = {
@@ -855,7 +855,7 @@ static void telnet_reconfig(void *handle, Conf *conf)
 /*
  * Called to send data down the Telnet connection.
  */
-static int telnet_send(void *handle, char *buf, int len)
+static int telnet_send(void *handle, const char *buf, int len)
 {
     Telnet telnet = (Telnet) handle;
     unsigned char *p, *end;