Skip to content

Commit

Permalink
Input: aiptek - tolerate newlines in sysfs files
Browse files Browse the repository at this point in the history
Now echo "some value" > /sys/......./somefile is also acceptable.

Signed-off-by: Rene van Paassen <rene.vanpaassen@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Rene van Paassen authored and Dmitry Torokhov committed Jul 10, 2007
1 parent b3b6cf1 commit 0112db3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/input/tablet/aiptek.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,11 @@ static int map_str_to_val(const struct aiptek_map *map, const char *str, size_t
{
const struct aiptek_map *p;

if (str[count - 1] == '\n')
count--;

for (p = map; p->string; p++)
if (!strncmp(str, p->string, count))
if (!strncmp(str, p->string, count))
return p->value;

return AIPTEK_INVALID_VALUE;
Expand Down

0 comments on commit 0112db3

Please sign in to comment.