diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-06-19 02:19:23 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-06-19 02:19:23 +0000 |
commit | 86164ef8dd357589678b205432c4bbc7b3f71f23 (patch) | |
tree | afea8afa8d61c2dfe50b61489e8a245d3498f2e6 /converter/pbm | |
parent | 3d1f13e6864c97b75d0894fb85f0a3b1ad0775b9 (diff) | |
download | netpbm-mirror-86164ef8dd357589678b205432c4bbc7b3f71f23.tar.gz netpbm-mirror-86164ef8dd357589678b205432c4bbc7b3f71f23.tar.xz netpbm-mirror-86164ef8dd357589678b205432c4bbc7b3f71f23.zip |
Fix bugs from previous cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2552 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/pbm')
-rw-r--r-- | converter/pbm/pbmtopi3.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/converter/pbm/pbmtopi3.c b/converter/pbm/pbmtopi3.c index b3669372..791bcb50 100644 --- a/converter/pbm/pbmtopi3.c +++ b/converter/pbm/pbmtopi3.c @@ -12,6 +12,8 @@ ** implied warranty. */ +/* Output file should always be 32034 bytes. */ + #include <stdio.h> #include "pm_c_util.h" #include "pbm.h" @@ -28,7 +30,6 @@ putinit(FILE * const ofP) { for (i = 1; i < 16; ++i) { pm_writebigshort (ofP, (short) 0); - pm_writebigshort (ofP, (short) 0); } } @@ -73,7 +74,7 @@ main(int argc, const char ** argv) { putinit(stdout); - for (row = 0; row < inRows; ++row) { + for (row = 0; row < MIN(inRows, outRows); ++row) { pbm_readpbmrow_packed(ifP, bitrow, inCols, format); pbm_cleanrowend_packed(bitrow, inCols); fwrite (bitrow, outColByteCt, 1, stdout); |