Commit e5da34e8 authored by Bastien Nocera's avatar Bastien Nocera Committed by Daniel Drake

Fix fp_get_pollfds()

It was increasing i too early, and writing past the allocated
structures.
parent d816fed5
......@@ -308,9 +308,10 @@ API_EXPORTED size_t fp_get_pollfds(struct fp_pollfd **pollfds)
ret = g_malloc(sizeof(struct fp_pollfd) * cnt);
i = 0;
while ((usbfd = usbfds[i++]) != NULL) {
while ((usbfd = usbfds[i]) != NULL) {
ret[i].fd = usbfd->fd;
ret[i].events = usbfd->events;
i++;
}
*pollfds = ret;
......
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