]> git.lizzy.rs Git - zlib.git/blobdiff - examples/gzappend.c
Avoid an undefined behavior of memcpy() in gzappend().
[zlib.git] / examples / gzappend.c
index 662dec3794b7c0f799fcb8e9feb1a1f43a3a46da..d7eea3e97a51ef4295839151194abe75111cc701 100644 (file)
@@ -137,7 +137,7 @@ local void rotate(unsigned char *list, unsigned len, unsigned rot)
     /* do simple left shift by one */
     if (rot == 1) {
         tmp = *list;
-        memcpy(list, list + 1, len - 1);
+        memmove(list, list + 1, len - 1);
         *last = tmp;
         return;
     }