diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2019-06-18 10:54:47 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2019-06-18 10:54:47 +0100 |
commit | d4d7d6948e41c2573b47645191dbb7e3877f0597 (patch) | |
tree | 3da95f548f457833e30c7003ab9f485a13b9fbc6 /contrib/pcl3/eprn | |
parent | 29da5d218dac7e0975c03a81982fdc33b5eba20d (diff) | |
download | ghostpdl-d4d7d6948e41c2573b47645191dbb7e3877f0597.tar.gz |
Fix up some coverity issues, and other warnings
CIDs: 341120, 341119, 341118, 341117, 341116, 341115, 341114, 341113, 341112,
341111, 341110, 341109, 341108, 341107, 341106, 341105, 341104, 341103, 341102,
341101.
Mostly examples of gp_fseek and sscanf ignoring return values.
Diffstat (limited to 'contrib/pcl3/eprn')
-rw-r--r-- | contrib/pcl3/eprn/pagecount.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/pcl3/eprn/pagecount.c b/contrib/pcl3/eprn/pagecount.c index f5ba13d6e..a635bd451 100644 --- a/contrib/pcl3/eprn/pagecount.c +++ b/contrib/pcl3/eprn/pagecount.c @@ -142,7 +142,7 @@ int pcf_getcount(const gs_memory_t *mem, const char *filename, unsigned long *co gp_file *f; /* Should we use a page count file? */ - if (filename == NULL || *filename == '\0') return 0; + if (filename == NULL || *filename == '\0' || count == NULL) return 0; /* If the file does not exist, the page count is taken to be zero. */ if (access(filename, F_OK) != 0) { @@ -153,7 +153,7 @@ int pcf_getcount(const gs_memory_t *mem, const char *filename, unsigned long *co /* Open the file */ if ((f = gp_fopen(mem, filename, "r")) == NULL) { errprintf(mem, ERRPREFIX "Cannot open page count file `%s': %s.\n", - filename, strerror(gp_ferror(f))); + filename, strerror(errno)); return -1; } @@ -206,7 +206,7 @@ int pcf_inccount(const gs_memory_t *mem, const char *filename, unsigned long by) */ if ((f = gp_fopen(mem, filename, "a+")) == NULL) { errprintf(mem, ERRPREFIX "Cannot open page count file `%s': %s.\n", - filename, strerror(gp_ferror(f))); + filename, strerror(errno)); return 1; } @@ -239,7 +239,7 @@ int pcf_inccount(const gs_memory_t *mem, const char *filename, unsigned long by) if (f1 == NULL) { errprintf(mem, ERRPREFIX "Error opening page count file `%s' a second time: %s.\n", - filename, strerror(gp_ferror(f1))); + filename, strerror(errno)); rc = 1; } else { |