Hi Paul,

Paul J. Lucas "Paul J. Lucas" <[EMAIL PROTECTED]>:
>       I'm not the original author of the code, so I don't understand
>       the compression algorithm very well, so I'm not inclined to make
>       a hack fix without knowing the real problem.
>
I think put_byte() in txt2pdbdoc.c is problematic.

NEWBUFFER() allocated a buffer of BUFFERSIZE (6000) bytes and put_byte() 
put up to RECORD_SIZE_MAX (4096) characters into.

But if there are characters > 0x80, then a '\1' will be prepended. If 
all characters will be > 0x80, we will need  
BUFFERSIZE = RECORD_SIZE_MAX * 2.

I have attached the change as a patch, please proove it and consider to 
apply it.

There are additional patches of previous bugs, perhaps you are 
interested.

A new Debian package is prepared and wait for upload.


Kindly regards,
Erik


-- 
 www.ErikSchanze.de *********************************************
 Bitte keine HTML-E-Mails! No HTML mails, please! Limit: 100 kB *
         - Chemnitzer Linux-Tage am 4. und 5. März 2006         *
             Info: http://chemnitzer.linux-tage.de/             *
--- txt2pdbdoc-1.4.4.orig/configure
+++ txt2pdbdoc-1.4.4/configure
@@ -1210,7 +1210,7 @@
 
 # Define the identity of the package.
  PACKAGE=txt2pdbdoc
- VERSION=1.4.3
+ VERSION=1.4.4
 
 cat >>confdefs.h <<EOF
 #define PACKAGE "$PACKAGE"
--- txt2pdbdoc-1.4.4.orig/html2pdbtxt.1
+++ txt2pdbdoc-1.4.4/html2pdbtxt.1
@@ -36,7 +36,7 @@
 ..
 .\" ---------------------------------------------------------------------------
 .tr ~
-.TH \f3html2pdbtxt\fP 1 "June 15, 2001" "html2pdbtxt"
+.TH \f3html2pdbtxt\fP 1 "January 21, 2005" "html2pdbtxt"
 .SH NAME
 html2pdbtxt \- HTML to Doc Text converter for Palm Pilots
 .SH SYNOPSIS
@@ -129,7 +129,7 @@
 To convert an HTML file to Doc:
 .cS
 html2pdbtxt -u http://www.wonderland.org/ alice.html alice.txt
-txt2pdbdoc `head -1 alice.txt` alice.txt alice.pdb
+txt2pdbdoc "`head -1 alice.txt`" alice.txt alice.pdb
 .cE
 .SH CAVEATS
 .TP 4
@@ -151,9 +151,7 @@
 since it would have to be parsed
 rather than simple substitutions being performed.
 .SH SEE ALSO
-.BR pdbtxt2html (1),
-.BR txt2pdbdoc (1),
-.BR doc (4)
+pdbtxt2html(1), txt2pdbdoc(1), doc(4), pdb(4)
 .PP
 International Standards Organization.
 ``ISO 8859-1: Information Processing
--- txt2pdbdoc-1.4.4.orig/txt2pdbdoc.c
+++ txt2pdbdoc-1.4.4/txt2pdbdoc.c
@@ -46,7 +46,7 @@
 #define	true		1
 
 /* constants */
-#define	BUFFER_SIZE	6000		/* big enough for uncompressed record */
+#define	BUFFER_SIZE	(RECORD_SIZE_MAX * 2) /* big enough for uncompressed record */
 #define	COMPRESSED	2
 #define	COUNT_BITS	3		/* why this value?  I don't know */
 #define	DISP_BITS	11		/* ditto */

Reply via email to