From 774ce4cc3ff29ba7e85c0bace4c2beaa0a39ff02 Mon Sep 17 00:00:00 2001 From: Tommi Rantala Date: Wed, 4 Mar 2015 13:45:10 +0200 Subject: Use sizeof(ev) to specify array size to read() For easy experimentation with different buffer sizes, it is more convenient to specify the array size to read() with sizeof(ev) instead of having the array element count in two places. Signed-off-by: Peter Hutterer --- evtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evtest.c b/evtest.c index 1f9b908..0077899 100644 --- a/evtest.c +++ b/evtest.c @@ -1043,7 +1043,7 @@ static int print_events(int fd) select(fd + 1, &rdfs, NULL, NULL, NULL); if (stop) break; - rd = read(fd, ev, sizeof(struct input_event) * 64); + rd = read(fd, ev, sizeof(ev)); if (rd < (int) sizeof(struct input_event)) { printf("expected %d bytes, got %d\n", (int) sizeof(struct input_event), rd); -- cgit v1.2.3