]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/blobdiff - printing.c
First draft of Unicode support in pterm. It's pretty complete: it
[PuTTY_svn.git] / printing.c
index 964f4b5235d727a10995efa6be1ca3a1d3374cc6..17bf6ffa08f112a9a9568a6094c183496b41d185 100644 (file)
@@ -39,9 +39,13 @@ static char *printer_add_enum(int param, char *buffer,
 
     buffer = srealloc(buffer, offset+512);
 
-    if (EnumPrinters(param, NULL, ENUM_LEVEL, buffer+offset,
-                     512, &needed, &nprinters) == 0)
-        return NULL;
+    /*
+     * Exploratory call to EnumPrinters to determine how much space
+     * we'll need for the output. Discard the return value since it
+     * will almost certainly be a failure due to lack of space.
+     */
+    EnumPrinters(param, NULL, ENUM_LEVEL, buffer+offset, 512,
+                &needed, &nprinters);
 
     if (needed < 512)
         needed = 512;