about summary refs log tree commit diff
path: root/editor/pnmremap.c
diff options
context:
space:
mode:
Diffstat (limited to 'editor/pnmremap.c')
-rw-r--r--editor/pnmremap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/editor/pnmremap.c b/editor/pnmremap.c
index 5b58addb..db35e2c0 100644
--- a/editor/pnmremap.c
+++ b/editor/pnmremap.c
@@ -377,6 +377,24 @@ randomizeError(long **      const err,
 
 
 static void
+zeroError(long **      const err,
+          unsigned int const width,
+          unsigned int const depth) {
+/*----------------------------------------------------------------------------
+   Set all errors to zero in the error array err[][].
+-----------------------------------------------------------------------------*/
+    unsigned int col;
+
+    for (col = 0; col < width; ++col) {
+        unsigned int plane;
+        for (plane = 0; plane < depth; ++plane) 
+            err[plane][col] = 0;
+    }
+}
+
+
+
+static void
 fserrSetForward(struct fserr * const fserrP) {
 
     fserrP->fsForward = TRUE;
@@ -433,6 +451,8 @@ initFserr(struct pam *   const pamP,
 
     if (initRandom)
         randomizeError(fserrP->thiserr, fserrSize, pamP->depth);
+    else
+        zeroError(fserrP->thiserr, fserrSize, pamP->depth);
 
     fserrSetForward(fserrP);
 }