From b44588f3b6e65f3d5c7b7afd4f8ca29088f6afbd Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Thu, 28 Feb 2008 16:12:43 -0300 Subject: [PATCH] Fix some address of 'var' will always evaluate as 'true' warnings. These probably remain from some other version of the code where a pointer instead of an stack vector was used. --- src/xkb/XKBMisc.c | 2 +- src/xlibi18n/lcFile.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/xkb/XKBMisc.c b/src/xkb/XKBMisc.c index 515b293..15e168b 100644 --- a/src/xkb/XKBMisc.c +++ b/src/xkb/XKBMisc.c @@ -669,7 +669,7 @@ register int i; int width,nOldGroups,oldWidth,newTypes[XkbNumKbdGroups]; if ((!xkb) || (!XkbKeycodeInRange(xkb,key)) || (!xkb->map) || - (!xkb->map->types)||(!newTypes)||((groups&XkbAllGroupsMask)==0)|| + (!xkb->map->types)||((groups&XkbAllGroupsMask)==0)|| (nGroups>XkbNumKbdGroups)) { return BadMatch; } diff --git a/src/xlibi18n/lcFile.c b/src/xlibi18n/lcFile.c index 5e50b5b..cd96159 100644 --- a/src/xlibi18n/lcFile.c +++ b/src/xlibi18n/lcFile.c @@ -504,15 +504,17 @@ _XlcFileName( siname = XLC_PUBLIC(lcd, siname); - lowercase(cat, category); + if (category) + lowercase(cat, category); + else + cat[0] = '\0'; xlocaledir(dir,XLC_BUFSIZE); n = _XlcParsePath(dir, args, NUM_LOCALEDIR); for (i = 0; i < n; ++i) { char buf[PATH_MAX], *name; name = NULL; - if ((5 + (args[i] ? strlen (args[i]) : 0) + - (cat ? strlen (cat) : 0)) < PATH_MAX) { + if ((5 + (args[i] ? strlen (args[i]) : 0) + strlen (cat)) < PATH_MAX) { sprintf(buf, "%s/%s.dir", args[i], cat); name = resolve_name(siname, buf, RtoL); } -- 1.5.4.3