about summary refs log tree commit diff
path: root/converter/ppm
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2018-10-07 19:44:50 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2018-10-07 19:44:50 +0000
commitdad0d6c7ac7b24374e024223e7da1a8b170b1436 (patch)
tree859d1b7bbfad052c212eb7140c20528a965dbc25 /converter/ppm
parent7058c14b1e8ae4184d8bbbd29df725abf38371b9 (diff)
downloadnetpbm-mirror-dad0d6c7ac7b24374e024223e7da1a8b170b1436.tar.gz
netpbm-mirror-dad0d6c7ac7b24374e024223e7da1a8b170b1436.tar.xz
netpbm-mirror-dad0d6c7ac7b24374e024223e7da1a8b170b1436.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3395 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm')
-rw-r--r--converter/ppm/xvminitoppm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/converter/ppm/xvminitoppm.c b/converter/ppm/xvminitoppm.c
index 34a0f9b5..ad207ae9 100644
--- a/converter/ppm/xvminitoppm.c
+++ b/converter/ppm/xvminitoppm.c
@@ -96,10 +96,8 @@ readXvHeader(FILE *         const ifP,
     bufferSz = 0; /* initial value */
 
     pm_getline(ifP, &buf, &bufferSz, &eof, &lineLen);
-    if (eof)
-        pm_error("Unexpected EOF");
 
-    if (!strneq(buf, "P7 332", 6))
+    if (eof || !strneq(buf, "P7 332", 6))
         pm_error("Input is not a XV thumbnail picture.  It does not "
                  "begin with the characters 'P7 332'.");
 
@@ -108,7 +106,7 @@ readXvHeader(FILE *         const ifP,
         size_t lineLen;
         pm_getline(ifP, &buf, &bufferSz, &eof, &lineLen);
         if (eof)
-            pm_error("Unexpected EOF");
+            pm_error("EOF before #END_OF_COMMENTS line");
         if (strneq(buf, "#END_OF_COMMENTS", 16))
             endOfComments = true;
         else if (strneq(buf, "#BUILTIN", 8))
@@ -117,7 +115,7 @@ readXvHeader(FILE *         const ifP,
     }
     pm_getline(ifP, &buf, &bufferSz, &eof, &lineLen);
     if (eof)
-        pm_error("Unexpected EOF");
+        pm_error("EOF where cols/rows/maxval line expected");
 
     rc = sscanf(buf, "%u %u %u", &cols, &rows, &maxval);
     if (rc != 3)