summaryrefslogtreecommitdiff
path: root/utils/hp2ps
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-05-06 00:08:30 +0000
committerIan Lynagh <igloo@earth.li>2010-05-06 00:08:30 +0000
commit34f6af3564a597c8b502256ae07f2d0c2c5f962a (patch)
tree9faf255d324156cee8908f03b950cc3fc9d1d3a2 /utils/hp2ps
parentc5b76e6f1d2151dd76a2e6477c543a4dd1efca46 (diff)
downloadhaskell-34f6af3564a597c8b502256ae07f2d0c2c5f962a.tar.gz
Detect EOF when trying to parse a string in hp2ps
Diffstat (limited to 'utils/hp2ps')
-rw-r--r--utils/hp2ps/HpFile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/hp2ps/HpFile.c b/utils/hp2ps/HpFile.c
index 1f2bf2d8d0..787a268229 100644
--- a/utils/hp2ps/HpFile.c
+++ b/utils/hp2ps/HpFile.c
@@ -416,7 +416,10 @@ GetString(infp)
i = 0;
while (ch != '\"') {
- if (i == stringbuffersize - 1) {
+ if (ch == EOF) {
+ Error("%s, line %d: EOF when expecting \"", hpfile, linenum, ch);
+ }
+ else if (i == stringbuffersize - 1) {
stringbuffersize = 2 * stringbuffersize;
stringbuffer = xrealloc(stringbuffer, stringbuffersize);
}