]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix a mistaken use of a format string in logevent().
authorSimon Tatham <anakin@pobox.com>
Fri, 27 Nov 2015 23:55:16 +0000 (23:55 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 27 Nov 2015 23:55:16 +0000 (23:55 +0000)
logevent() doesn't do printf-style formatting (though the logeventf
wrapper in ssh.c does), so if you need to format a message, it has to
be done separately with dupprintf.

windows/window.c

index baed768f10a4c4ae5d181bdf4bd1535ea97c4521..fc51e57fb2b5fbbe95fbdc37d76831dd7cee2e82 100644 (file)
@@ -398,8 +398,10 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
 #ifndef UNPROTECT
         char *error = NULL;
         if (! setprocessacl(error)) {
-           logevent(NULL, "Could not restrict process ACL: %s",
-                    error);
+            char *message = dupprintf("Could not restrict process ACL: %s",
+                                      error);
+           logevent(NULL, message);
+            sfree(message);
            sfree(error);
        }
 #endif