From 2ff0a5061be1456662a1010b8ea21e11c6a9cce4 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 16 Jan 2014 19:52:42 +0900 Subject: [PATCH] wrong timing and offset for buffer shifting in reading --- src/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/port.c b/src/port.c index 9ef8f220..ee1bfccb 100644 --- a/src/port.c +++ b/src/port.c @@ -185,8 +185,8 @@ pic_fread(void *ptr, size_t block, size_t nitems, pic_file *file) avail = file->c - file->s; if (size <= avail) { memcpy(dst, file->s, size); + memmove(file->s, file->s + size, avail - size); file->c -= size; - memmove(file->s, file->c, avail - size); break; } else {