aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/src/xlibi18n/lcFile.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/src/xlibi18n/lcFile.c')
-rw-r--r--nx-X11/lib/src/xlibi18n/lcFile.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/nx-X11/lib/src/xlibi18n/lcFile.c b/nx-X11/lib/src/xlibi18n/lcFile.c
index cf03a90a7..e4fc8a00b 100644
--- a/nx-X11/lib/src/xlibi18n/lcFile.c
+++ b/nx-X11/lib/src/xlibi18n/lcFile.c
@@ -36,6 +36,9 @@
/************************************************************************/
+#ifndef HAVE_SETEUID
+# define seteuid setuid
+#endif
#define iscomment(ch) ((ch) == '#' || (ch) == '\0')
#if defined(WIN32)
#define isreadable(f) (_XAccessFile(f))
@@ -142,7 +145,7 @@ _XlcParsePath(
for (i = 0; i < n; ++i) {
int len;
p = argv[i];
- len = strlen(p);
+ len = (int) strlen(p);
if (len > 0 && p[len - 1] == '/') {
/* eliminate trailing slash */
p[len - 1] = '\0';
@@ -172,7 +175,7 @@ xlocaledir(
if (dir) {
#ifndef WIN32
/*
- * Only use the user-supplied path if the process isn't priviledged.
+ * Only use the user-supplied path if the process isn't privileged.
*/
if (getuid() == geteuid() && getgid() == getegid()) {
#if defined(HASSETUGID)
@@ -187,7 +190,7 @@ xlocaledir(
}
#else
/*
- * If there are saved ID's the process might still be priviledged
+ * If there are saved ID's the process might still be privileged
* even though the above test succeeded. If issetugid() and
* getresgid() aren't available, test this by trying to set
* euid to 0.
@@ -202,7 +205,7 @@ xlocaledir(
priv = 0;
} else {
if (seteuid(oldeuid) == -1) {
- /* XXX ouch, coudn't get back to original uid
+ /* XXX ouch, couldn't get back to original uid
what can we do ??? */
_exit(127);
}
@@ -214,8 +217,8 @@ xlocaledir(
priv = 0;
#endif
if (!priv) {
- len = strlen(dir);
- strncpy(p, dir, buf_len);
+ len = (int) strlen(dir);
+ strncpy(p, dir, (size_t) buf_len);
if (len < buf_len) {
p[len++] = LC_PATHDELIM;
p += len;
@@ -225,7 +228,7 @@ xlocaledir(
#endif /* NO_XLOCALEDIR */
if (len < buf_len)
- strncpy(p, XLOCALEDIR, buf_len - len);
+ strncpy(p, XLOCALEDIR, (size_t) (buf_len - len));
buf[buf_len-1] = '\0';
}
@@ -246,7 +249,7 @@ xlocalelibdir(
if (dir) {
#ifndef WIN32
/*
- * Only use the user-supplied path if the process isn't priviledged.
+ * Only use the user-supplied path if the process isn't privileged.
*/
if (getuid() == geteuid() && getgid() == getegid()) {
#if defined(HASSETUGID)
@@ -261,7 +264,7 @@ xlocalelibdir(
}
#else
/*
- * If there are saved ID's the process might still be priviledged
+ * If there are saved ID's the process might still be privileged
* even though the above test succeeded. If issetugid() and
* getresgid() aren't available, test this by trying to set
* euid to 0.
@@ -276,7 +279,7 @@ xlocalelibdir(
priv = 0;
} else {
if (seteuid(oldeuid) == -1) {
- /* XXX ouch, coudn't get back to original uid
+ /* XXX ouch, couldn't get back to original uid
what can we do ??? */
_exit(127);
}
@@ -288,8 +291,8 @@ xlocalelibdir(
priv = 0;
#endif
if (!priv) {
- len = strlen(dir);
- strncpy(p, dir, buf_len);
+ len = (int) strlen(dir);
+ strncpy(p, dir, (size_t) buf_len);
if (len < buf_len) {
p[len++] = LC_PATHDELIM;
p += len;
@@ -299,7 +302,7 @@ xlocalelibdir(
#endif /* NO_XLOCALEDIR */
if (len < buf_len)
- strncpy(p, XLOCALELIBDIR, buf_len - len);
+ strncpy(p, XLOCALELIBDIR, (size_t) (buf_len - len));
buf[buf_len-1] = '\0';
}
@@ -361,7 +364,7 @@ lowercase(
char *t;
for (s = src, t = dst; *s; ++s, ++t)
- *t = c_tolower(*s);
+ *t = (char) c_tolower(*s);
*t = '\0';
return dst;
}
@@ -387,7 +390,7 @@ normalize_lcname (const char *name)
*p++ = *tmp++;
while (*tmp) {
if (*tmp != '-')
- *p++ = c_tolower(*tmp);
+ *p++ = (char) c_tolower(*tmp);
tmp++;
}
}
@@ -504,7 +507,7 @@ _XlcResolveLocaleName(
pub->siname = name;
}
- sinamelen = strlen (pub->siname);
+ sinamelen = (int) strlen (pub->siname);
if (sinamelen == 1 && pub->siname[0] == 'C') {
pub->language = pub->siname;
pub->territory = pub->codeset = NULL;