Eliminate a warning from valgrind, that might potentially be reporting actual

trouble.
This commit is contained in:
Steve Underwood 2013-12-07 01:57:59 +08:00
parent 6c5a17894c
commit eb3e843692
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ static __inline__ void normalise_history(plc_state_t *s)
if (s->buf_ptr == 0)
return;
memcpy(tmp, s->history, sizeof(int16_t)*s->buf_ptr);
memcpy(s->history, s->history + s->buf_ptr, sizeof(int16_t)*(PLC_HISTORY_LEN - s->buf_ptr));
memmove(s->history, s->history + s->buf_ptr, sizeof(int16_t)*(PLC_HISTORY_LEN - s->buf_ptr));
memcpy(s->history + PLC_HISTORY_LEN - s->buf_ptr, tmp, sizeof(int16_t)*s->buf_ptr);
s->buf_ptr = 0;
}