But below has no error:
memmove(
&list.id[ count2 ],
&list.id[ count2 + 1 ],
sizeof(list.id[0]) * (count1 - count2));
Error: The index value 1..495 may be used for array 'id' of size 400.
I am not sure the regarding the values suggested by the tool.
Is the first really has a chance of overflow.
I think the +1 on destination causes this error.
How should I fix it.
That is right.
If those were not satisfied, it will cause lock.
But those codes work. It is just that the analysis tool reported an error.
Is there other way to modify this just to erradicate the error on analysis tool?
We can't see the code that manipulates the values that count1 and count2 hold, so it is impossible to give any intelligent advice concerning them except to caution you as Peter87 has done.
I found it.
For the fix, you have to include that code inside a condition.
A condition to check that count1 + 1 is less than the maximum index of the array id.