From 9aef0cdac0c6380221564bbcb86f6d1c72e2dc8e Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 16 Jan 2014 19:51:40 +0900 Subject: [PATCH] get rid of a small redundant code --- src/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/port.c b/src/port.c index df05ea98..9ef8f220 100644 --- a/src/port.c +++ b/src/port.c @@ -191,7 +191,7 @@ pic_fread(void *ptr, size_t block, size_t nitems, pic_file *file) } else { memcpy(dst, file->s, avail); - file->c -= avail; + file->c = file->s; size -= avail; dst += avail; pic_ffill(file); @@ -212,7 +212,7 @@ pic_fwrite(const void *ptr, size_t block, size_t nitems, pic_file *file) room = file->e - file->c; if (room < size) { memcpy(file->c, dst, room); - file->c += room; + file->c = file->e; size -= room; dst += room; pic_fflush(file);