]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Harvey Kwok observes that EnumPrinters() can sometimes fail to fill
authorSimon Tatham <anakin@pobox.com>
Fri, 21 Sep 2007 18:04:08 +0000 (18:04 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 21 Sep 2007 18:04:08 +0000 (18:04 +0000)
in its output parameters. Hence, we initialise them before calling
it.

[originally from svn r7729]

windows/winprint.c

index b8696520090dae3902b32041b810f78e282f3b31..1548c3c92b34d46297adda60669df385efa514fc 100644 (file)
@@ -21,7 +21,7 @@ struct printer_job_tag {
 static char *printer_add_enum(int param, DWORD level, char *buffer,
                               int offset, int *nprinters_ptr)
 {
-    DWORD needed, nprinters;
+    DWORD needed = 0, nprinters = 0;
 
     buffer = sresize(buffer, offset+512, char);