Becouse these functions return a size_t, they can't return negitive numbers.
authorAndrew Bartlett <abartlet@samba.org>
Thu, 2 Jan 2003 13:01:44 +0000 (13:01 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 2 Jan 2003 13:01:44 +0000 (13:01 +0000)
So a < 0 check is pointless, instead check against -1, which will be cast to
unsigned.

Andrew Bartlett
(This used to be commit c7e5797a95804d5779cdfc93795adcdf2fe82a59)

source3/nsswitch/winbindd_pam.c
source3/smbd/mangle_hash.c

index c5b68ea0583592472bfd4be9e5e6d3e1839f6bf5..398b001f8bff8e5b24428bb4c1ca9b04cf42c01e 100644 (file)
@@ -185,13 +185,13 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
                goto done;
        }
 
-        if (pull_utf8_talloc(mem_ctx, &user, state->request.data.auth_crap.user) < 0) {
+        if (pull_utf8_talloc(mem_ctx, &user, state->request.data.auth_crap.user) == -1) {
                DEBUG(0, ("winbindd_pam_auth_crap: pull_utf8_talloc failed!\n"));
        }
 
        if (*state->request.data.auth_crap.domain) {
                char *dom = NULL;
-               if (pull_utf8_talloc(mem_ctx, &dom, state->request.data.auth_crap.domain) < 0) {
+               if (pull_utf8_talloc(mem_ctx, &dom, state->request.data.auth_crap.domain) == -1) {
                        DEBUG(0, ("winbindd_pam_auth_crap: pull_utf8_talloc failed!\n"));
                }
                domain = dom;
@@ -215,7 +215,7 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
 
        if (*state->request.data.auth_crap.workstation) {
                char *wrk = NULL;
-               if (pull_utf8_talloc(mem_ctx, &wrk, state->request.data.auth_crap.workstation) < 0) {
+               if (pull_utf8_talloc(mem_ctx, &wrk, state->request.data.auth_crap.workstation) == -1) {
                        DEBUG(0, ("winbindd_pam_auth_crap: pull_utf8_talloc failed!\n"));
                }
                workstation = wrk;
index 929cb0e07fa53387d1763d04eeab6b7342a20644..ac9c13dcaccb647eba2c3b133411ea3c058c3874 100644 (file)
@@ -730,7 +730,7 @@ static void name_map(char *OutName, BOOL need83, BOOL cache83)
        DEBUG(5,("name_map( %s, need83 = %s, cache83 = %s)\n", OutName,
                 need83 ? "True" : "False", cache83 ? "True" : "False"));
        
-       if (push_ucs2_allocate(&OutName_ucs2, OutName) < 0) {
+       if (push_ucs2_allocate(&OutName_ucs2, OutName) == -1 ) {
                DEBUG(0, ("push_ucs2_allocate failed!\n"));
                return;
        }