diff options
Diffstat (limited to 'converter/ppm/xvminitoppm.c')
-rw-r--r-- | converter/ppm/xvminitoppm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/converter/ppm/xvminitoppm.c b/converter/ppm/xvminitoppm.c index 935ab177..d76bea87 100644 --- a/converter/ppm/xvminitoppm.c +++ b/converter/ppm/xvminitoppm.c @@ -12,6 +12,7 @@ #include <assert.h> #include <string.h> +#include <errno.h> #include "pm_c_util.h" #include "nstring.h" @@ -61,7 +62,8 @@ getLine(FILE * const ifP, rc = fgets(buf, size, ifP); if (rc == NULL) { if (ferror(ifP)) - pm_perror("read error"); + pm_error("read error. fgets() failed, errno=%d (%s)", + errno, strerror(errno)); else pm_error("unexpected EOF"); } @@ -107,16 +109,16 @@ readXvHeader(FILE * const ifP, getLine(ifP, buf, sizeof(buf)); - if (!STRNEQ(buf, "P7 332", 6)) + if (!strneq(buf, "P7 332", 6)) pm_error("Input is not a XV thumbnail picture. It does not " "begin with the characters 'P7 332'."); endOfComments = FALSE; while (!endOfComments) { getLine(ifP, buf, sizeof(buf)); - if (STRNEQ(buf, "#END_OF_COMMENTS", 16)) + if (strneq(buf, "#END_OF_COMMENTS", 16)) endOfComments = TRUE; - else if (STRNEQ(buf, "#BUILTIN", 8)) + else if (strneq(buf, "#BUILTIN", 8)) pm_error("This program does not know how to " "convert builtin XV thumbnail pictures"); } |