HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] PDF files sent via sendfax get an incorrect page count?



Adam D. Morley wrote:

I'm using Hylafax 4.3.0 from Debian backports on i386 Debian sarge.  It
works great except that when I submit a PDF via sendfax, faxcover is
told that the PDF has one more page than it really does.  I've tried
multiple PDFs (generated from StarOffice, scanned, downloaded).  Here is
one:

http://www.sun.com/servers/entry/x4100/datasheet.pdf


A small buglet, an oversight.


A patch to fix it is attached.

Thanks,

Lee.
--- hylafax.orig/util/SendFaxClient.c++	2006-11-01 12:14:08.000000000 -0800
+++ hylafax/util/SendFaxClient.c++	2006-11-10 15:11:31.626249544 -0800
@@ -797,7 +797,8 @@
                     endbuf = cp+len;    // Will only change on the last pass.
 	            cp = line;
 	            while ((cp = (char *) memchr((const char*) cp, '/', endbuf-cp-slen))) {
-	                if (((memcmp(cp, "/Type /Page", slen-1) == 0) || (memcmp(cp, "/Type/Page", slen-2) == 0)) && (*(cp+slen-1) != 's'))
+	                if ((memcmp(cp, "/Type /Page", slen-1) == 0 && *(cp+slen-1) != 's') || 
+			    (memcmp(cp, "/Type/Page",  slen-2) == 0 && *(cp+slen-2) != 's'))
 	                    npages++;
 			cp++;
 	            }



Project hosted by iFAX Solutions