diff options
-rw-r--r-- | rpmoffset.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rpmoffset.c b/rpmoffset.c index 80ed563..b8f5a04 100644 --- a/rpmoffset.c +++ b/rpmoffset.c @@ -52,12 +52,13 @@ int main(int argc, char *argv[]) } } + memmove(p, p + left + read_cnt - MAGIC_SIZE + 1, MAGIC_SIZE - 1); + offset += read_cnt; if (left == 0) { offset -= MAGIC_SIZE - 1; left = MAGIC_SIZE - 1; } - memmove(p, p + read_cnt - MAGIC_SIZE - 1, MAGIC_SIZE - 1); } if (ferror(stdin)) |