]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winmisc.c
Use correct type to print Windows error codes.
[PuTTY.git] / windows / winmisc.c
index 3b57adf8f66ebbfc9c5fe5aa40153a5e3d75b689..ce0a0d1d2a55e7fb8d545817a5330afb057fe7d3 100644 (file)
@@ -5,6 +5,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "putty.h"
+#ifndef SECURITY_WIN32
+#define SECURITY_WIN32
+#endif
 #include <security.h>
 
 OSVERSIONINFO osVersion;
@@ -219,8 +222,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 %u)",
+                    (unsigned int)GetLastError());
         } else {
             int len = strlen(msgtext);
             if (len > 0 && msgtext[len-1] == '\n')
@@ -238,7 +241,7 @@ static FILE *debug_fp = NULL;
 static HANDLE debug_hdl = INVALID_HANDLE_VALUE;
 static int debug_got_console = 0;
 
-void dputs(char *buf)
+void dputs(const char *buf)
 {
     DWORD dw;