Index: filter/hpgl-input.c
===================================================================
--- filter/hpgl-input.c	(revision 8816)
+++ filter/hpgl-input.c	(working copy)
@@ -144,7 +144,7 @@
   if (!strcasecmp(name, "LB"))
   {
     bufptr = buf;
-    while ((ch = getc(fp)) != StringTerminator)
+    while ((ch = getc(fp)) != StringTerminator && ch != EOF)
       if (bufptr < (buf + sizeof(buf) - 1))
         *bufptr++ = ch;
     *bufptr = '\0';
