diff options
author | Gerald Carter <jerry@samba.org> | 2005-02-17 15:17:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:40 -0500 |
commit | 732f09990fda978fe1cbef786d6b2d15897e6f97 (patch) | |
tree | a1a023f980ab1d08786219d49bcdca08e8c5a61e | |
parent | f51677051cc139bdeb9d66196ca5405cecce1a35 (diff) | |
download | samba-732f09990fda978fe1cbef786d6b2d15897e6f97.tar.gz samba-732f09990fda978fe1cbef786d6b2d15897e6f97.tar.bz2 samba-732f09990fda978fe1cbef786d6b2d15897e6f97.zip |
r5431: couple of cimpile fixes from Jason Mader <jason@ncac.gwu.edu> -- BUGS 2341 & 2342
(This used to be commit 0edcfc7fa20fd8e3273b29c8f1a97cb7c7179fb6)
-rw-r--r-- | source3/auth/auth_util.c | 2 | ||||
-rw-r--r-- | source3/lib/util_unistr.c | 24 |
2 files changed, 16 insertions, 10 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 7a186f65cd..f3c01a58ca 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -61,7 +61,6 @@ static int smb_create_user(const char *domain, const char *unix_username, const void auth_add_user_script(const char *domain, const char *username) { - uint32 rid; /* * User validated ok against Domain controller. * If the admin wants us to try and create a UNIX @@ -79,7 +78,6 @@ void auth_add_user_script(const char *domain, const char *username) if ( !winbind_create_user(username, NULL) ) { DEBUG(5,("auth_add_user_script: winbindd_create_user() failed\n")); - rid = 0; } } } diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index bb9d69b164..55a21ebcbb 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -454,16 +454,20 @@ smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n) smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins) { smb_ucs2_t *r; - size_t slen, inslen; + size_t inslen; + + if (!s || !*s || !ins || !*ins) + return NULL; - if (!s || !*s || !ins || !*ins) return NULL; - slen = strlen_w(s); inslen = strlen_w(ins); r = (smb_ucs2_t *)s; + while ((r = strchr_w(r, *ins))) { - if (strncmp_w(r, ins, inslen) == 0) return r; + if (strncmp_w(r, ins, inslen) == 0) + return r; r++; } + return NULL; } @@ -736,16 +740,20 @@ smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p) smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins) { smb_ucs2_t *r; - size_t slen, inslen; + size_t inslen; + + if (!s || !*s || !ins || !*ins) + return NULL; - if (!s || !*s || !ins || !*ins) return NULL; - slen = strlen_w(s); inslen = strlen(ins); r = (smb_ucs2_t *)s; + while ((r = strchr_w(r, UCS2_CHAR(*ins)))) { - if (strncmp_wa(r, ins, inslen) == 0) return r; + if (strncmp_wa(r, ins, inslen) == 0) + return r; r++; } + return NULL; } |