diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-12-07 17:36:14 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-12-07 17:36:14 +0000 |
commit | 840f7ed6c9daf8cba4b0282bc91504eec7413882 (patch) | |
tree | fb3841a394820e8e408afa9c491154cbb65b70e0 /converter/other/pnmtops.c | |
parent | 57cf96a1025c97f0ea049f54782e4ff45cb8cfbb (diff) | |
download | netpbm-mirror-840f7ed6c9daf8cba4b0282bc91504eec7413882.tar.gz netpbm-mirror-840f7ed6c9daf8cba4b0282bc91504eec7413882.tar.xz netpbm-mirror-840f7ed6c9daf8cba4b0282bc91504eec7413882.zip |
Improve error messages for output I/O error
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2049 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pnmtops.c')
-rw-r--r-- | converter/other/pnmtops.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c index 2d76e6e9..0a3379dc 100644 --- a/converter/other/pnmtops.c +++ b/converter/other/pnmtops.c @@ -398,6 +398,16 @@ writeFileChar(const char * const buffer, +static void +writeFileByte(unsigned char const byte, + const char * const name, + FILE * const ofP) { + + writeFile(&byte, 1, name, ofP); +} + + + #define MAX_FILTER_CT 10 /* The maximum number of filters this code is capable of applying */ @@ -642,10 +652,10 @@ rlePutBuffer (bool const repeatMode, assert(count <= 128); if (repeatMode) { - fputc((257 - count) % 256, fP); - fputc(repeatitem, fP); + writeFileByte((257 - count) % 256, "rlePutBuffer", fP); + writeFileByte(repeatitem, "rlePutBuffer", fP); } else { - fputc(count - 1, fP); + writeFileByte(count - 1, "rlePutBuffer", fP); writeFile(itembuf, count, "rlePutBuffer", fP); } } |