summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-06 22:32:57 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-06 22:32:57 +0000
commita732bcd9d2677dde13cb95859c90edf86fb88984 (patch)
tree1c350ddeff7a3d19d0a18a91704da7e12378cd07 /source3
parentda9fb5ba388a16f7adeb7403fee74e1981735d1e (diff)
downloadsamba-a732bcd9d2677dde13cb95859c90edf86fb88984.tar.gz
samba-a732bcd9d2677dde13cb95859c90edf86fb88984.tar.bz2
samba-a732bcd9d2677dde13cb95859c90edf86fb88984.zip
fixed strrchr_m
(This used to be commit f4359b5f7ff891d7fcb5772b589756376ae5d412)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_unistr.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index b90532d7dc..09a9eda3ad 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -95,7 +95,7 @@ int rpcstr_push(void* dest, const char *src, int dest_len, int flags)
units. Always null terminates.
Hack alert: uses fixed buffer(s).
********************************************************************/
-char *dos_unistrn2(uint16 *src, int len)
+char *dos_unistrn2(const uint16 *src, int len)
{
static char lbufs[8][MAXUNI];
static int nexti;
@@ -312,10 +312,9 @@ smb_ucs2_t *strrchr_wa(const smb_ucs2_t *s, char c)
int len = strlen_w(s);
if (len == 0) return NULL;
p += (len-1);
- while (p != s) {
+ do {
if (UCS2_CHAR(c) == *p) return (smb_ucs2_t *)p;
- p--;
- }
+ } while (p-- != s);
return NULL;
}