diff options
Diffstat (limited to 'src/iobuf.c')
| -rw-r--r-- | src/iobuf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/iobuf.c b/src/iobuf.c index 199e0d8..6516a2c 100644 --- a/src/iobuf.c +++ b/src/iobuf.c | |||
| @@ -68,6 +68,8 @@ int mtdev_pull(struct mtdev *dev, int fd, int max_events) | |||
| 68 | struct mtdev_state *state = dev->state; | 68 | struct mtdev_state *state = dev->state; |
| 69 | struct input_event ev; | 69 | struct input_event ev; |
| 70 | int ret, count = 0; | 70 | int ret, count = 0; |
| 71 | if (max_events <= 0) | ||
| 72 | max_events = DIM_EVENTS; | ||
| 71 | while (max_events-- && !evbuf_full(&state->inbuf)) { | 73 | while (max_events-- && !evbuf_full(&state->inbuf)) { |
| 72 | ret = mtdev_fetch(dev, fd, &ev); | 74 | ret = mtdev_fetch(dev, fd, &ev); |
| 73 | if (ret < 0) | 75 | if (ret < 0) |
