summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-04-29 16:23:32 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-05-08 14:51:28 +1000
commitd0c9619675d26284f03ef428ff76cc09bdd4ace3 (patch)
tree8b574f94781a4564daa827263bf7863e1a445502
parent5a327955c9287a317e5792e96601375fa5aabced (diff)
Init LEDs to zero before querying the value
This way if the ioctl fails we don't set any unintended LEDs, but really this patch is more to silence valgrind: ==7129== Conditional jump or move depends on uninitialised value(s) ==7129== at 0x8DF99A1: GetKbdLeds (lnx_kbd.c:79) ==7129== by 0x8DF8853: InitKBD (kbd.c:291) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/lnx_kbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lnx_kbd.c b/src/lnx_kbd.c
index e69e1b6..811a7d7 100644
--- a/src/lnx_kbd.c
+++ b/src/lnx_kbd.c
@@ -70,7 +70,7 @@ SetKbdLeds(InputInfoPtr pInfo, int leds)
static int
GetKbdLeds(InputInfoPtr pInfo)
{
- char real_leds;
+ char real_leds = 0;
int leds = 0;
ioctl(pInfo->fd, KDGETLED, &real_leds);