diff options
author | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2013-11-15 20:35:12 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2013-11-15 20:35:44 +0100 |
commit | 491f0a170c72271a7a9ce049fbcfe81f08cff162 (patch) | |
tree | a0756e6e45d9bde9ea6a93b037f0db2d7a87818d /utils/pdftotext.cc | |
parent | 78c407ac7e8f48ae2d2c75ad0f5960390190d2e3 (diff) |
pdftotext: Escape the text of the xml headers
Diffstat (limited to 'utils/pdftotext.cc')
-rw-r--r-- | utils/pdftotext.cc | 6 |
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); } |