summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-28 20:44:02 -0500
committerJune McEnroe <programble@gmail.com>2018-02-28 20:44:02 -0500
commit0de3f61bbbc3bc8f8646d66f3defc4cf2c719721 (patch)
tree08fa93b9befcd9ff7d5c961c206dc7c3cc9a5a74
parentOpen watch files O_CLOEXEC (diff)
downloadsrc-0de3f61bbbc3bc8f8646d66f3defc4cf2c719721.tar.gz
src-0de3f61bbbc3bc8f8646d66f3defc4cf2c719721.zip
Use memmove in pngo where needed
Diffstat (limited to '')
-rw-r--r--bin/pngo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/pngo.c b/bin/pngo.c
index c79ce0e6..31daf40e 100644
--- a/bin/pngo.c
+++ b/bin/pngo.c
@@ -455,7 +455,7 @@ static void discardAlpha(void) {
     for (uint32_t y = 0; y < header.height; ++y) {
         *ptr++ = lines[y]->type;
         for (uint32_t x = 0; x < header.width; ++x) {
-            memcpy(ptr, &lines[y]->data[x * pixelSize], colorSize);
+            memmove(ptr, &lines[y]->data[x * pixelSize], colorSize);
             ptr += colorSize;
         }
     }
@@ -482,10 +482,10 @@ static void discardColor(void) {
         *ptr++ = lines[y]->type;
         for (uint32_t x = 0; x < header.width; ++x) {
             uint8_t *pixel = &lines[y]->data[x * pixelSize];
-            memcpy(ptr, pixel, sampleSize);
+            memmove(ptr, pixel, sampleSize);
             ptr += sampleSize;
             if (header.color == TRUECOLOR_ALPHA) {
-                memcpy(ptr, pixel + 3 * sampleSize, sampleSize);
+                memmove(ptr, pixel + 3 * sampleSize, sampleSize);
                 ptr += sampleSize;
             }
         }