]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Remove unused strnrchr_w
authorVolker Lendecke <vl@samba.org>
Thu, 27 Jun 2024 15:54:56 +0000 (17:54 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 4 Jul 2024 15:26:36 +0000 (15:26 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/util/charset/charset.h
lib/util/charset/util_unistr_w.c

index 8452b5766d1679b12655dbae5bcb1d74f8af6c15..4316c1b2c6cebdf032b3947ded02d193966a03cc 100644 (file)
@@ -292,7 +292,6 @@ size_t strnlen_w(const smb_ucs2_t *src, size_t max);
 smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
 smb_ucs2_t *strchr_wa(const smb_ucs2_t *s, char c);
 smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
-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);
 bool strlower_w(smb_ucs2_t *s);
 bool strupper_w(smb_ucs2_t *s);
index 88d5531bb7102e5a2883fc1e4d9cd5479e989539..e49b796bac4a4dac61cbb9ffd7c679d485644e4c 100644 (file)
@@ -114,32 +114,6 @@ smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c)
        return NULL;
 }
 
-/*******************************************************************
- Wide version of strrchr that returns after doing strrchr 'n' times.
-********************************************************************/
-
-smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n)
-{
-       smb_ucs2_t cp;
-       const smb_ucs2_t *p = s;
-       int len = strlen_w(s);
-
-       if (len == 0 || !n) {
-               return NULL;
-       }
-       p += (len - 1);
-       do {
-               if (c == *(COPY_UCS2_CHAR(&cp,p))) {
-                       n--;
-               }
-
-               if (!n) {
-                       return discard_const_p(smb_ucs2_t, p);
-               }
-       } while (p-- != s);
-       return NULL;
-}
-
 /*******************************************************************
  Wide strstr().
 ********************************************************************/