提交 eb3e8436 authored 作者: Steve Underwood's avatar Steve Underwood

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

trouble.
上级 6c5a1789
...@@ -84,7 +84,7 @@ static __inline__ void normalise_history(plc_state_t *s) ...@@ -84,7 +84,7 @@ static __inline__ void normalise_history(plc_state_t *s)
if (s->buf_ptr == 0) if (s->buf_ptr == 0)
return; return;
memcpy(tmp, s->history, sizeof(int16_t)*s->buf_ptr); 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); memcpy(s->history + PLC_HISTORY_LEN - s->buf_ptr, tmp, sizeof(int16_t)*s->buf_ptr);
s->buf_ptr = 0; s->buf_ptr = 0;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论