Add discover server options
[petitboot] / lib / waiter / waiter.c
index 214dfda0b4786d7d42293e7ff25c406c7528814a..68f483acac03adaea7955cf91dd1fc2f2197a75a 100644 (file)
@@ -43,7 +43,8 @@ void waiter_remove(struct waiter *waiter)
        assert(i >= 0 && i < n_waiters);
 
        n_waiters--;
-       memmove(&waiters[i], &waiters[i+1], n_waiters - i);
+       memmove(&waiters[i], &waiters[i+1],
+               (n_waiters - i) * sizeof(waiters[0]));
 
        waiters = talloc_realloc(NULL, waiters, struct waiter, n_waiters);
 }