aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkb
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/xkb')
-rw-r--r--xorg-server/xkb/xkb.c12
-rw-r--r--xorg-server/xkb/xkbLEDs.c12
2 files changed, 15 insertions, 9 deletions
diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c
index 62152b66a..2b06f3187 100644
--- a/xorg-server/xkb/xkb.c
+++ b/xorg-server/xkb/xkb.c
@@ -3273,20 +3273,21 @@ _XkbFindNamedIndicatorMap(XkbSrvLedInfoPtr sli, Atom indicator,
int *led_return)
{
XkbIndicatorMapPtr map;
- int led;
/* search for the right indicator */
map = NULL;
if (sli->names && sli->maps) {
+ int led;
+
for (led = 0; (led < XkbNumIndicators) && (map == NULL); led++) {
if (sli->names[led] == indicator) {
map= &sli->maps[led];
+ *led_return = led;
break;
}
}
}
- *led_return = led;
return map;
}
@@ -4298,9 +4299,12 @@ ProcXkbSetNames(ClientPtr client)
static char *
XkbWriteCountedString(char *wire,char *str,Bool swap)
{
-CARD16 len,*pLen;
+ CARD16 len,*pLen;
+
+ if (!str)
+ return wire;
- len= (str?strlen(str):0);
+ len= strlen(str);
pLen= (CARD16 *)wire;
*pLen= len;
if (swap) {
diff --git a/xorg-server/xkb/xkbLEDs.c b/xorg-server/xkb/xkbLEDs.c
index 59cdba416..6ca80d784 100644
--- a/xorg-server/xkb/xkbLEDs.c
+++ b/xorg-server/xkb/xkbLEDs.c
@@ -745,12 +745,14 @@ XkbFlushLedEvents( DeviceIntPtr dev,
XkbDDXAccessXBeep(dev, _BEEP_LED_OFF, XkbAccessXFeedbackMask);
}
}
- if (ed && (ed->reason)) {
- if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
- XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
- XkbSendExtensionDeviceNotify(dev,cause->client,ed);
+ if (ed) {
+ if (ed->reason) {
+ if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
+ XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
+ XkbSendExtensionDeviceNotify(dev,cause->client,ed);
+ }
+ bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
}
- bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
return;
}