[PATCH evemu] Rewind the fp to the beginning of the first event line

Peter Hutterer peter.hutterer at who-t.net
Mon Jul 27 19:35:31 PDT 2015


evemu_read reads lines until they start with E:, i.e. the first event line.
evemu_read_event then contines from that position. This causes us to miss the
first event.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evemu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/evemu.c b/src/evemu.c
index 8b149b0..19a372b 100644
--- a/src/evemu.c
+++ b/src/evemu.c
@@ -691,6 +691,8 @@ int evemu_read(struct evemu_device *dev, FILE *fp)
 
 	rc = 1;
 
+	fseek(fp, -strlen(line), SEEK_CUR);
+
 out:
 	free(line);
 	return rc;
-- 
2.4.3



More information about the Input-tools mailing list