summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2013-11-15 20:35:12 +0100
committerAlbert Astals Cid <aacid@kde.org>2013-11-15 20:35:44 +0100
commit491f0a170c72271a7a9ce049fbcfe81f08cff162 (patch)
treea0756e6e45d9bde9ea6a93b037f0db2d7a87818d /utils
parent78c407ac7e8f48ae2d2c75ad0f5960390190d2e3 (diff)
pdftotext: Escape the text of the xml headers
Diffstat (limited to 'utils')
-rw-r--r--utils/pdftotext.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index 62ba3a32..bd687ec8 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);
}