[PATCH 16/18] input: aiptek - tolerate newlines in sysfs files

[email protected]
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
From: Rene van Paassen <[email protected]>

now echo "some value" > /sys/......./somefile is also acceptable
By the way, all trailing characters are ignored

Signed-off-by: Rene van Paassen <[email protected]>
---
 drivers/usb/input/aiptek.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
index 5cdd000..1c3029c 100644
--- a/drivers/usb/input/aiptek.c
+++ b/drivers/usb/input/aiptek.c
@@ -376,7 +376,7 @@ static int map_str_to_val(const struct aiptek_map *map, const char *str)
 	const struct aiptek_map *p;
 
 	for (p = map; p->string; p++)
-		if (!strcmp(str, p->string))
+	        if (!strncmp(str, p->string, strlen(p->string)))
 			return p->value;
 
 	return AIPTEK_INVALID_VALUE;
-- 
1.5.0.6


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.