summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/test1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/test1.c b/examples/test1.c
index 849a41e..6db7665 100644
--- a/examples/test1.c
+++ b/examples/test1.c
@@ -28,8 +28,8 @@ int main(int argc, char *argv[])
parsed = vt100_screen_process_string(vt, buf, bytes + offset);
if (parsed < bytes + offset) {
- memcpy(buf, buf + parsed, bytes - parsed);
- offset = bytes - parsed;
+ memmove(buf, buf + parsed, bytes + offset - parsed);
+ offset = bytes + offset - parsed;
}
}