fixed warnings on irix and crash bug on big endian machines
authorAndrew Tridgell <tridge@samba.org>
Thu, 20 Dec 2001 10:02:30 +0000 (10:02 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 20 Dec 2001 10:02:30 +0000 (10:02 +0000)
(This used to be commit cc6c263993eaf0715f231fc80ca7e6e65694548b)

source3/lib/username.c
source3/lib/util_sock.c
source3/lib/util_str.c
source3/lib/util_unistr.c

index 17627d4dae056cc24d60aca943f537016bfdcc08..8154a2b40e4932a662a0cc985eff704f00f86bf9 100644 (file)
@@ -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);
index 045e18ac228a167f61721ffbd92a4bfd0678ebc2..a56a9741935fcf6dfe103d252f08ab2ed8b7d050 100644 (file)
@@ -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) );
                        }
index 2205f5cf0d0a1153627ea11f71045e680c85d9d8..14d50384c28070efda32bee5e4f2b48a4d5a5db5 100644 (file)
@@ -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')
index 08fc1760ae813c2e895b4b022dbf6ee55a8c6f11..0a0424763df9cd30047610c97a59e6a6e7b2ba43 100644 (file)
@@ -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);
+       }
 }