Commit d57cfb63 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Fix off-by-one error

parent ea0debf8
......@@ -139,7 +139,7 @@ static struct channel *channel_get(struct list *list, int index)
static int channel_set(struct list *list, int index, struct channel channel)
{
if (list->capacity < index) {
if (list->capacity <= index) {
int capacity = index + 1;
void *new = realloc(list->channel, capacity * sizeof(*list->channel));
if (new) {
......
Supports Markdown
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