diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-03-27 01:46:26 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-03-27 01:46:26 +0000 |
commit | dff6b9fdfeb78fe21a66aa459ddc1d5f7e362dfa (patch) | |
tree | b147568ccffc4cdba9e2a98de1452450ba8e55c3 /lib/libppm2.c | |
parent | 4ce684c4978610d1ea42be1b00f7332f3f5f337a (diff) | |
download | netpbm-mirror-dff6b9fdfeb78fe21a66aa459ddc1d5f7e362dfa.tar.gz netpbm-mirror-dff6b9fdfeb78fe21a66aa459ddc1d5f7e362dfa.tar.xz netpbm-mirror-dff6b9fdfeb78fe21a66aa459ddc1d5f7e362dfa.zip |
Promote Advanced (10.73) to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@2692 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/libppm2.c')
-rw-r--r-- | lib/libppm2.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/libppm2.c b/lib/libppm2.c index 3bf74bd4..694ecdd7 100644 --- a/lib/libppm2.c +++ b/lib/libppm2.c @@ -14,8 +14,8 @@ #include <errno.h> -#include "pm_c_util.h" -#include "mallocvar.h" +#include "netpbm/pm_c_util.h" +#include "netpbm/mallocvar.h" #include "ppm.h" void @@ -36,10 +36,6 @@ ppm_writeppminit(FILE* const fileP, PPM_MAGIC1, plainFormat || maxval >= 1<<16 ? PPM_MAGIC2 : RPPM_MAGIC2, cols, rows, maxval ); -#ifdef VMS - if (!plainFormat) - set_outfile_binary(); -#endif } @@ -133,10 +129,13 @@ ppm_writeppmrowraw(FILE * const fileP, if (rc < 0) pm_error("Error writing row. fwrite() errno=%d (%s)", errno, strerror(errno)); - else if (rc != bytesPerRow) - pm_error("Error writing row. Short write of %u bytes " - "instead of %u", rc, bytesPerRow); + else { + size_t const bytesWritten = rc; + if (bytesWritten != bytesPerRow) + pm_error("Error writing row. Short write of %u bytes " + "instead of %u", (unsigned)bytesWritten, bytesPerRow); + } free(rowBuffer); } |