]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winmisc.c
Make kh2reg.py compatible with modern Python.
[PuTTY.git] / windows / winmisc.c
index 7823b43e4917745369485938fd404ee940dac305..5bf52141ca7aa1fab834e0d67a559d675cfd481d 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "putty.h"
+#define SECURITY_WIN32
 #include <security.h>
 
 OSVERSIONINFO osVersion;
@@ -210,7 +211,6 @@ const char *win_strerror(int error)
     es = find234(errstrings, &error, errstring_find);
 
     if (!es) {
-        int bufsize;
         char msgtext[65536]; /* maximum size for FormatMessage is 64K */
 
         es = snew(struct errstring);
@@ -220,8 +220,8 @@ const char *win_strerror(int error)
                            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                            msgtext, lenof(msgtext)-1, NULL)) {
             sprintf(msgtext,
-                    "(unable to format: FormatMessage returned %d)", 
-                    error, GetLastError());
+                    "(unable to format: FormatMessage returned %d)",
+                    GetLastError());
         } else {
             int len = strlen(msgtext);
             if (len > 0 && msgtext[len-1] == '\n')