aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTommi Rantala <tommi.rantala@g-cluster.com>2015-03-04 13:45:10 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2015-03-05 08:47:50 +1000
commit774ce4cc3ff29ba7e85c0bace4c2beaa0a39ff02 (patch)
tree598bfea22e8b070c8be394c3c4168b2c51a7c25b
parent84e74462416779bc9a0346cf82b957f444c6e0bc (diff)
downloadexternal_evtest-774ce4cc3ff29ba7e85c0bace4c2beaa0a39ff02.tar.gz
external_evtest-774ce4cc3ff29ba7e85c0bace4c2beaa0a39ff02.tar.bz2
external_evtest-774ce4cc3ff29ba7e85c0bace4c2beaa0a39ff02.zip
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 <peter.hutterer@who-t.net>
-rw-r--r--evtest.c2
1 files changed, 1 insertions, 1 deletions
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);