summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-12-20 10:02:30 +0000
committerAndrew Tridgell <tridge@samba.org>2001-12-20 10:02:30 +0000
commit93d458c5f68a7168ce543e820906bc55a5d3a339 (patch)
treed12058b745c122f95c005b23047a32e716011ed0
parent89f97bb254ac71b5fff8bf6d703578ac900c7ed1 (diff)
downloadsamba-93d458c5f68a7168ce543e820906bc55a5d3a339.tar.gz
samba-93d458c5f68a7168ce543e820906bc55a5d3a339.tar.bz2
samba-93d458c5f68a7168ce543e820906bc55a5d3a339.zip
fixed warnings on irix and crash bug on big endian machines
(This used to be commit cc6c263993eaf0715f231fc80ca7e6e65694548b)
-rw-r--r--source3/lib/username.c8
-rw-r--r--source3/lib/util_sock.c2
-rw-r--r--source3/lib/util_str.c4
-rw-r--r--source3/lib/util_unistr.c6
4 files changed, 12 insertions, 8 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c
index 17627d4dae..8154a2b40e 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -127,13 +127,13 @@ BOOL map_username(char *user)
*dosname++ = 0;
- while (isspace(*unixname))
+ while (isspace((int)*unixname))
unixname++;
if ('!' == *unixname) {
return_if_mapped = True;
unixname++;
- while (*unixname && isspace(*unixname))
+ while (*unixname && isspace((int)*unixname))
unixname++;
}
@@ -142,7 +142,7 @@ BOOL map_username(char *user)
{
int l = strlen(unixname);
- while (l && isspace(unixname[l-1])) {
+ while (l && isspace((int)unixname[l-1])) {
unixname[l-1] = 0;
l--;
}
@@ -574,7 +574,7 @@ static struct passwd *uname_string_combinations2(char *s,int offset,struct passw
for (i=offset;i<(len-(N-1));i++) {
char c = s[i];
- if (!islower(c))
+ if (!islower((int)c))
continue;
s[i] = toupper(c);
ret = uname_string_combinations2(s,i+1,fn,N-1);
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 045e18ac22..a56a974193 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -814,7 +814,7 @@ int open_socket_in( int type, int port, int dlevel, uint32 socket_addr, BOOL reb
if( setsockopt(res,SOL_SOCKET,SO_REUSEPORT,(char *)&val,sizeof(val)) == -1 ) {
if( DEBUGLVL( dlevel ) ) {
dbgtext( "open_socket_in(): setsockopt: ");
- dbgtext( "SO_REUSEPORT = %d ", val?"True":"False" );
+ dbgtext( "SO_REUSEPORT = %s ", val?"True":"False" );
dbgtext( "on port %d failed ", port );
dbgtext( "with error = %s\n", strerror(errno) );
}
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 2205f5cf0d..14d50384c2 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -198,9 +198,9 @@ int strwicmp(const char *psz1, const char *psz2)
/* sync the strings on first non-whitespace */
while (1)
{
- while (isspace(*psz1))
+ while (isspace((int)*psz1))
psz1++;
- while (isspace(*psz2))
+ while (isspace((int)*psz2))
psz2++;
if (toupper(*psz1) != toupper(*psz2) || *psz1 == '\0'
|| *psz2 == '\0')
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 08fc1760ae..0a0424763d 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -105,7 +105,11 @@ void init_valid_table(void)
valid_table = malloc(0x10000);
for (i=0;i<128;i++) valid_table[UCS2_CHAR(i)] = isalnum(i) ||
strchr(allowed,i);
- for (;i<0x10000;i++) valid_table[UCS2_CHAR(i)] = check_dos_char(i);
+ for (;i<0x10000;i++) {
+ smb_ucs2_t c;
+ SSVAL(&c, 0, i);
+ valid_table[c] = check_dos_char(c);
+ }
}