[PATCH evemu] Ignore carriage return in device names

Peter Hutterer peter.hutterer at who-t.net
Thu May 12 04:29:11 UTC 2016


bugzilla attachments sometimes have CRLF as end of line, make sure we ignore
that for the device name. Otherwise our device name contains the \r, affecting
printfs.

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

diff --git a/src/evemu.c b/src/evemu.c
index fff4ebe..2ef0367 100644
--- a/src/evemu.c
+++ b/src/evemu.c
@@ -432,7 +432,7 @@ static int parse_name(struct evemu_device *dev, const char *line)
 	int matched;
 	char *devname = NULL;
 
-	if ((matched = sscanf(line, "N: %m[^\n]\n", &devname)) > 0) {
+	if ((matched = sscanf(line, "N: %m[^\n\r]\n", &devname)) > 0) {
 		if (strlen(evemu_get_name(dev)) == 0)
 			evemu_set_name(dev, devname);
 	}
-- 
2.7.4



More information about the Input-tools mailing list