]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fixed strrchr_m
authorAndrew Tridgell <tridge@samba.org>
Fri, 6 Jul 2001 22:32:57 +0000 (22:32 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 6 Jul 2001 22:32:57 +0000 (22:32 +0000)
source/lib/util_unistr.c

index b90532d7dc52a99893e60c8515c66cb4ce44a087..09a9eda3ad0375071621d3fa9d6ba812a49b9a30 100644 (file)
@@ -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;
 }