util: allow for palm pressure > 255

https://bugs.freedesktop.org/show_bug.cgi?id=105753

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-04-30 10:40:45 +10:00
parent c0fd857def
commit 59eb10e593
2 changed files with 2 additions and 5 deletions

View file

@ -425,9 +425,7 @@ parse_palm_pressure_property(const char *prop)
if (!prop)
return 0;
if (!safe_atoi(prop, &threshold) ||
threshold < 0 ||
threshold > 255) /* No touchpad device has pressure > 255 */
if (!safe_atoi(prop, &threshold) || threshold < 0)
return 0;
return threshold;

View file

@ -1055,16 +1055,15 @@ START_TEST(palm_pressure_parser)
{ "1", 1 },
{ "10", 10 },
{ "255", 255 },
{ "360", 360 },
{ "-12", 0 },
{ "360", 0 },
{ "0", 0 },
{ "-0", 0 },
{ "a", 0 },
{ "10a", 0 },
{ "10-", 0 },
{ "sadfasfd", 0 },
{ "361", 0 },
{ NULL, 0 }
};