aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkb/xkbtext.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/xkb/xkbtext.c')
-rw-r--r--xorg-server/xkb/xkbtext.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/xorg-server/xkb/xkbtext.c b/xorg-server/xkb/xkbtext.c
index d08c91589..95ad01378 100644
--- a/xorg-server/xkb/xkbtext.c
+++ b/xorg-server/xkb/xkbtext.c
@@ -35,8 +35,8 @@
#include <X11/Xos.h>
#include <X11/X.h>
-#define NEED_EVENTS
#include <X11/Xproto.h>
+#include <X11/extensions/XKMformat.h>
#include "misc.h"
#include "inputstr.h"
#include "dix.h"
@@ -71,16 +71,17 @@ char *rtrn;
char *
XkbAtomText(Atom atm,unsigned format)
{
+const char *atmstr;
char *rtrn,*tmp;
- tmp= XkbAtomGetString(atm);
- if (tmp!=NULL) {
+ atmstr = XkbAtomGetString(atm);
+ if (atmstr != NULL) {
int len;
- len= strlen(tmp)+1;
+ len= strlen(atmstr)+1;
if (len>BUFFER_SIZE)
len= BUFFER_SIZE-2;
rtrn= tbGetBuffer(len);
- strncpy(rtrn,tmp,len);
+ strncpy(rtrn,atmstr,len);
rtrn[len]= '\0';
}
else {
@@ -105,7 +106,8 @@ XkbVModIndexText(XkbDescPtr xkb,unsigned ndx,unsigned format)
{
register int len;
register Atom *vmodNames;
-char *rtrn,*tmp;
+char *rtrn;
+const char *tmp;
char numBuf[20];
if (xkb && xkb->names)
@@ -117,8 +119,10 @@ char numBuf[20];
tmp= "illegal";
else if (vmodNames&&(vmodNames[ndx]!=None))
tmp= XkbAtomGetString(vmodNames[ndx]);
- if (tmp==NULL)
- sprintf(tmp=numBuf,"%d",ndx);
+ if (tmp==NULL) {
+ sprintf(numBuf,"%d",ndx);
+ tmp = numBuf;
+ }
len= strlen(tmp)+1;
if (format==XkbCFile)