summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-04-07 15:44:40 +0000
committerDaniel Stone <daniel@fooishbar.org>2006-04-07 15:44:40 +0000
commit25e8b874b9f58e5e8035957465252539df13a85d (patch)
tree29de76a5ec44581ef7fef2f1a86e0af25e1517d6
parent47dfc83937ed98e964716345cb4c8d817ae13e61 (diff)
Fix signed vs unsigned char hilarity. (Bill Crawford)
-rw-r--r--ChangeLog5
-rw-r--r--src/maprules.c16
2 files changed, 14 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index be03b08..83b613a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-07 Daniel Stone <daniel@freedesktop.org>
+
+ * src/maprules.c:
+ Fix signed vs unsigned char hilarity. (Bill Crawford)
+
2006-03-27 Daniel Stone <daniel@freedesktop.org>
* configure.ac:
diff --git a/src/maprules.c b/src/maprules.c
index 7986896..ab164c6 100644
--- a/src/maprules.c
+++ b/src/maprules.c
@@ -1353,7 +1353,8 @@ XkbRF_GetNamesProp(Display *dpy,char **rf_rtrn,XkbRF_VarDefsPtr vd_rtrn)
Atom rules_atom,actual_type;
int fmt;
unsigned long nitems,bytes_after;
-char *data,*out;
+unsigned char *data;
+char *out, *end;
Status rtrn;
rules_atom= XInternAtom(dpy,_XKB_RF_NAMES_PROP_ATOM,True);
@@ -1374,35 +1375,36 @@ Status rtrn;
return (fmt==0?True:False);
}
- out= data;
+ out=(char*)data;
+ end=out+nitems;
if (out && (*out) && rf_rtrn)
*rf_rtrn= _XkbDupString(out);
out+=strlen(out)+1;
- if ((out-data)<nitems) {
+ if (out<end) {
if (*out)
vd_rtrn->model= _XkbDupString(out);
out+=strlen(out)+1;
}
- if ((out-data)<nitems) {
+ if (out<end) {
if (*out)
vd_rtrn->layout= _XkbDupString(out);
out+=strlen(out)+1;
}
- if ((out-data)<nitems) {
+ if (out<end) {
if (*out)
vd_rtrn->variant= _XkbDupString(out);
out+=strlen(out)+1;
}
-
- if ((out-data)<nitems) {
+ if (out<end) {
if (*out)
vd_rtrn->options= _XkbDupString(out);
out+=strlen(out)+1;
}
+
XFree(data);
return True;
}