about summary refs log tree commit diff
path: root/editor/pbmclean.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2015-05-16 01:53:28 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2015-05-16 01:53:28 +0000
commit853d1761ee6b8796373a977603b31707b9c6459d (patch)
treef6868aaddee86c1a6894eb52532377ba288af252 /editor/pbmclean.c
parent4c050566e208acbbc2ac94d21208a93637a815c0 (diff)
downloadnetpbm-mirror-853d1761ee6b8796373a977603b31707b9c6459d.tar.gz
netpbm-mirror-853d1761ee6b8796373a977603b31707b9c6459d.tar.xz
netpbm-mirror-853d1761ee6b8796373a977603b31707b9c6459d.zip
Add and use pbm_cleanrowend_packed
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2488 9d0c8265-081b-0410-96cb-a4ca84ce46f8
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];