Commit 64916e4e authored by jothalha's avatar jothalha Committed by Tobias Ellinghaus

Fix string termination override on memmove. (#1645)

* Fix string termination override on memmove.

strlen returns the number of characters excluding the null
character. When shifting the string, that character has to be
included to avoid undefined behaviour.

* Revert changed comment.
parent 1697f8cf
......@@ -91,7 +91,7 @@ static int strinc(char *label, size_t buffer_size)
else if(c == label)
if(label_len + 1 >= buffer_size) return 0;
memmove(c + 1, c, label_len);
memmove(c + 1, c, label_len + 1);
*c = carry_over;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment