[poppler] Branch 'poppler-0.24' - utils/pdftotext.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Nov 15 11:35:55 PST 2013


 utils/pdftotext.cc |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 491f0a170c72271a7a9ce049fbcfe81f08cff162
Author: suzuki toshiya <mpsuzuki at hiroshima-u.ac.jp>
Date:   Fri Nov 15 20:35:12 2013 +0100

    pdftotext: Escape the text of the xml headers

diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index 62ba3a3..bd687ec 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -439,7 +439,7 @@ static void printInfoString(FILE *f, Dict *infoDict, const char *key,
   GooString *s1;
   GBool isUnicode;
   Unicode u;
-  char buf[8];
+  char buf[9];
   int i, n;
 
   if (infoDict->lookup(key, &obj)->isString()) {
@@ -463,7 +463,9 @@ static void printInfoString(FILE *f, Dict *infoDict, const char *key,
 	++i;
       }
       n = uMap->mapUnicode(u, buf, sizeof(buf));
-      fwrite(buf, 1, n, f);
+      buf[n] = '\0';
+      const std::string myString = myXmlTokenReplace(buf);
+      fputs(myString.c_str(), f);
     }
     fputs(text2, f);
   }


More information about the poppler mailing list