about summary refs log tree commit diff
path: root/editor/pbmclean.c
diff options
context:
space:
mode:
Diffstat (limited to 'editor/pbmclean.c')
-rw-r--r--editor/pbmclean.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/editor/pbmclean.c b/editor/pbmclean.c
index 6d813090..46e7dee6 100644
--- a/editor/pbmclean.c
+++ b/editor/pbmclean.c
@@ -361,10 +361,8 @@ setupInputBuffers(FILE *       const ifP,
 
     pbm_readpbmrow_packed(ifP, nextRow, cols, format);
 
-    if (cols % 8 > 0){
-        nextRow[pbm_packed_bytes(cols) -1 ] >>= (8 - cols % 8);
-        nextRow[pbm_packed_bytes(cols) -1 ] <<= (8 - cols % 8);
-    }
+    pbm_cleanrowend_packed(nextRow, cols);
+
     *bufferP  = buffer;
     *edgeRowP = edgeRow;
     *thisRowP = &edgeRow[1];
@@ -418,10 +416,8 @@ cleanSimple(FILE *             const ifP,
                handling of the initial edgerow.
             */
             pbm_readpbmrow_packed(ifP, nextRow, cols, format);
-            if (cols % 8 > 0){
-                nextRow[pbm_packed_bytes(cols) -1 ] >>= (8 - cols % 8);
-                nextRow[pbm_packed_bytes(cols) -1 ] <<= (8 - cols % 8);
-            }
+            pbm_cleanrowend_packed(nextRow, cols);
+
         } else  /* Bottom of image.  */
             nextRow = &edgeRow[1];