]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Add some missing 'const' in version.c's string data.
authorSimon Tatham <anakin@pobox.com>
Thu, 7 Apr 2016 06:52:55 +0000 (07:52 +0100)
committerSimon Tatham <anakin@pobox.com>
Thu, 7 Apr 2016 06:52:55 +0000 (07:52 +0100)
I can't believe this codebase is around 20 years old and has had
multiple giant const-fixing patches, and yet there are _still_ things
that should have been const for years and aren't.

putty.h
ssh.h
version.c
windows/winpgen.c
windows/winpgnt.c

diff --git a/putty.h b/putty.h
index b06ff898411b2becfce93f2d0ad393baa60af989..cefb536475546f4984fde494ca462401a8594dd4 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -1158,7 +1158,7 @@ void ser_setup_config_box(struct controlbox *b, int midsession,
 /*
  * Exports from version.c.
  */
-extern char ver[];
+extern const char ver[];
 
 /*
  * Exports from unicode.c.
diff --git a/ssh.h b/ssh.h
index 7a7e8576e011963b88fe8c15a6c781d319bd1c62..16f076c827c001368049b2b6e956731ee0232bf5 100644 (file)
--- a/ssh.h
+++ b/ssh.h
@@ -489,7 +489,7 @@ void aes_ssh2_decrypt_blk(void *handle, unsigned char *blk, int len);
 /*
  * PuTTY version number formatted as an SSH version string. 
  */
-extern char sshver[];
+extern const char sshver[];
 
 /*
  * Gross hack: pscp will try to start SFTP but fall back to scp1 if
index f6086127e662159bfc5e462466bd8e44a4addd4b..9c94b6225e884f7b4f36c0dfde8b226eecddf2bd 100644 (file)
--- a/version.c
+++ b/version.c
@@ -10,8 +10,8 @@
 
 #include "version.h"
 
-char ver[] = TEXTVER;
-char sshver[] = SSHVER;
+const char ver[] = TEXTVER;
+const char sshver[] = SSHVER;
 
 /*
  * SSH local version string MUST be under 40 characters. Here's a
index 69171bc2947809625673e65bcfd9982be42b29c3..98319608c3ca1f562b57c95fa83b9e276e9c754d 100644 (file)
@@ -134,7 +134,7 @@ static void progress_update(void *param, int action, int phase, int iprogress)
     }
 }
 
-extern char ver[];
+extern const char ver[];
 
 struct PassphraseProcStruct {
     char **passphrase;
index bffc01f99a99f28d8e13068caf2725ee75aece02..86998a2bb49127c90e04ce8ce75c435335a23d5f 100644 (file)
@@ -49,7 +49,7 @@
 
 #define APPNAME "Pageant"
 
-extern char ver[];
+extern const char ver[];
 
 static HWND keylist;
 static HWND aboutbox;