Posted to tcl by emiliano at Thu Apr 24 21:16:57 GMT 2025view raw

  1. Index: win/tkWinGDI.c
  2. ==================================================================
  3. --- win/tkWinGDI.c
  4. +++ win/tkWinGDI.c
  5. @@ -3653,16 +3653,13 @@
  6. /*
  7. * Store print properties and link variables so they can be accessed from
  8. * script level.
  9. */
  10. if (localPrinterName != NULL) {
  11. - char* varlink1 = (char*)ckalloc(100 * sizeof(char));
  12. - char** varlink2 = (char**)ckalloc(sizeof(char*));
  13. - *varlink2 = varlink1;
  14. - WideCharToMultiByte(CP_UTF8, 0, localPrinterName, -1, varlink1, 0, NULL, NULL);
  15. + static char varlink[] = {'\0'};
  16.  
  17. - Tcl_LinkVar(interp, "::tk::print::printer_name", varlink2,
  18. + Tcl_LinkVar(interp, "::tk::print::printer_name", varlink,
  19. TCL_LINK_STRING | TCL_LINK_READ_ONLY);
  20. Tcl_LinkVar(interp, "::tk::print::copies", &copies,
  21. TCL_LINK_INT | TCL_LINK_READ_ONLY);
  22. Tcl_LinkVar(interp, "::tk::print::dpi_x", &dpi_x,
  23. TCL_LINK_INT | TCL_LINK_READ_ONLY);
  24.  
  25.  

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week