summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-11-10 13:09:00 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-11-16 13:44:05 +1000
commit602820f8201dc9f888a6fb3f654e7cd505e385a1 (patch)
tree60a9bcac640e3c3a38470a401807da799bbf2178
parentdc1edd140f10b459626d903382df28c74672739b (diff)
downloadlibinput-602820f8201dc9f888a6fb3f654e7cd505e385a1.tar.gz
Fix a few coverity complaints
All minor: - execdir does not need initialization, it's not used until written to - 'newest' could be NULL - zalloc(-1) confuses coverity - 't' is never used in that test Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit cfd8e6c76c9be6c4ebdbc4e822762be4a30142e6)
-rw-r--r--src/builddir.h2
-rw-r--r--src/evdev-mt-touchpad-thumb.c5
-rw-r--r--test/litest-selftest.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/builddir.h b/src/builddir.h
index 19825759..84aa8f68 100644
--- a/src/builddir.h
+++ b/src/builddir.h
@@ -35,7 +35,7 @@
static inline char *
builddir_lookup(void)
{
- char execdir[PATH_MAX] = {0};
+ char execdir[PATH_MAX];
char *pathsep;
ssize_t nread;
diff --git a/src/evdev-mt-touchpad-thumb.c b/src/evdev-mt-touchpad-thumb.c
index 2beaa54c..17b324e2 100644
--- a/src/evdev-mt-touchpad-thumb.c
+++ b/src/evdev-mt-touchpad-thumb.c
@@ -358,8 +358,9 @@ tp_thumb_update_multifinger(struct tp_dispatch *tp)
* the behavior of the other touches.)
*/
- if ((newest->initial_time - oldest->initial_time) < THUMB_TIMEOUT &&
- first->point.y < tp->thumb.lower_thumb_line) {
+ if (newest &&
+ (newest->initial_time - oldest->initial_time) < THUMB_TIMEOUT &&
+ first->point.y < tp->thumb.lower_thumb_line) {
tp_thumb_lift(tp);
return;
}
diff --git a/test/litest-selftest.c b/test/litest-selftest.c
index 75662a01..b7fbdb56 100644
--- a/test/litest-selftest.c
+++ b/test/litest-selftest.c
@@ -350,7 +350,7 @@ END_TEST
START_TEST(zalloc_overflow)
{
- zalloc(-1);
+ zalloc((size_t)-1);
}
END_TEST