about summary refs log tree commit diff
path: root/converter/other/pnmtops.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-11-24 22:05:21 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-11-24 22:05:21 +0000
commit4534ad8e87afa36c974140c97fe62b1523abeccc (patch)
tree9dc1dc37363e54fb5f7f8e34ed427684a0978f0d /converter/other/pnmtops.c
parent52da16976da4d738c8a0bdd35959af91ff5ae0bf (diff)
downloadnetpbm-mirror-4534ad8e87afa36c974140c97fe62b1523abeccc.tar.gz
netpbm-mirror-4534ad8e87afa36c974140c97fe62b1523abeccc.tar.xz
netpbm-mirror-4534ad8e87afa36c974140c97fe62b1523abeccc.zip
Fix bug: wrong output with -rle; line accidentally deleted when writeFile() introduced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2037 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pnmtops.c')
-rw-r--r--converter/other/pnmtops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index 5f5fcd7f..5efd5321 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -602,8 +602,10 @@ rlePutBuffer (unsigned int    const repeat,
     if (repeat) {
         fputc(257 - count,  fP);
         fputc(repeatitem, fP);
-    } else
+    } else {
+        fputc(count - 1, fP);
         writeFile(itembuf, count, "rlePutBuffer", fP);
+    }
 }
 
 
@@ -1011,7 +1013,7 @@ waitForChildren(const pid_t * const pidList) {
 -----------------------------------------------------------------------------*/
     /* There's an odd behavior in Unix such that if you have set the
        action for SIGCHLD to ignore the signal (even though ignoring the
-       siganl is the default), the process' children do not become
+       signal is the default), the process' children do not become
        zombies.  Consequently, waitpid() always fails with ECHILD - but
        nonetheless waits for the child to exit.