]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix % complete reporting in lpd backend so it doesn't wrap every
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 8 Mar 2001 14:40:53 +0000 (14:40 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 8 Mar 2001 14:40:53 +0000 (14:40 +0000)
40MB or so...

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@1617 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
backend/lpd.c

index 33bf302c0c157386f030e95ee632803ad1b6e717..fc7d53acc26cf0acbb1091b162031599140c8325 100644 (file)
@@ -81,6 +81,9 @@ CHANGES IN CUPS V1.1.7
          CGI was currently running.
        - cupsParseOptions() now sets boolean options to
          option=true or option=false.
+       - The "percent complete" calculations in the LPD backend
+         could overflow on large files, causing the percentage
+         to wrap to 0 every 40MB or so.
 
 
 CHANGES IN CUPS V1.1.6-3
index 4ee74a1a509310ae41f19310ba9e558040ac104a..8611d6bb16a1d3dba0fecb02aba4411557f46f0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: lpd.c,v 1.26 2001/03/06 16:06:05 mike Exp $"
+ * "$Id: lpd.c,v 1.27 2001/03/08 14:40:53 mike Exp $"
  *
  *   Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
  *
@@ -568,7 +568,7 @@ lpd_queue(char *hostname,   /* I - Host to connect to */
     while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
     {
       fprintf(stderr, "INFO: Spooling LPR job, %u%% complete...\n",
-              (unsigned)(100 * tbytes / filestats.st_size));
+              (unsigned)(100.0f * tbytes / filestats.st_size));
 
       if (lpd_write(fd, buffer, nbytes) < nbytes)
       {
@@ -657,5 +657,5 @@ lpd_write(int  lpd_fd,              /* I - LPD socket */
 
 
 /*
- * End of "$Id: lpd.c,v 1.26 2001/03/06 16:06:05 mike Exp $".
+ * End of "$Id: lpd.c,v 1.27 2001/03/08 14:40:53 mike Exp $".
  */