Skip to content

Commit 1d7e932

Browse files
committed
Fix overflow of one element in deque _remove
1 parent 92fa469 commit 1d7e932

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

m-deque.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@
720720
M_CALL_FREE(oplist, n); \
721721
} else { \
722722
memmove(&n->data[it->index], &n->data[it->index+1], \
723-
sizeof(type) * (it->node->size - it->index)); \
723+
sizeof(type) * (it->node->size - it->index - 1)); \
724724
/* We lose capacity of the node... */ \
725725
n->size --; \
726726
/* The iterator points to the next element \

0 commit comments

Comments
 (0)