]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Remove unused strnrchr_m
authorVolker Lendecke <vl@samba.org>
Thu, 27 Jun 2024 15:54:01 +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>
source3/include/proto.h
source3/lib/util_str.c

index bd7efce1f39f458f4a11dbe6e6d3fa12d28537ec..473407016aa71fdacf3a5e5b17bab2adad7f7bb5 100644 (file)
@@ -528,7 +528,6 @@ void all_string_sub(char *s,const char *pattern,const char *insert, size_t len);
 char *string_truncate(char *s, unsigned int length);
 char *strchr_m(const char *src, char c);
 char *strrchr_m(const char *s, char c);
-char *strnrchr_m(const char *s, char c, unsigned int n);
 char *strstr_m(const char *src, const char *findstr);
 bool strlower_m(char *s);
 bool strupper_m(char *s);
index 1591420587e33540b98818644f79dbb736475f1c..7c7872d68093c6572e12eb5c055a4592f95a7ee0 100644 (file)
@@ -192,41 +192,6 @@ char *string_truncate(char *s, unsigned int length)
        return s;
 }
 
-
-/***********************************************************************
- Return the equivalent of doing strrchr 'n' times - always going
- backwards.
-***********************************************************************/
-
-char *strnrchr_m(const char *s, char c, unsigned int n)
-{
-       smb_ucs2_t *ws = NULL;
-       char *s2 = NULL;
-       smb_ucs2_t *p;
-       char *ret;
-       size_t converted_size;
-
-       if (!push_ucs2_talloc(talloc_tos(), &ws, s, &converted_size)) {
-               /* Too hard to try and get right. */
-               return NULL;
-       }
-       p = strnrchr_w(ws, UCS2_CHAR(c), n);
-       if (!p) {
-               TALLOC_FREE(ws);
-               return NULL;
-       }
-       *p = 0;
-       if (!pull_ucs2_talloc(talloc_tos(), &s2, ws, &converted_size)) {
-               TALLOC_FREE(ws);
-               /* Too hard to try and get right. */
-               return NULL;
-       }
-       ret = discard_const_p(char, (s+strlen(s2)));
-       TALLOC_FREE(ws);
-       TALLOC_FREE(s2);
-       return ret;
-}
-
 static bool unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen)
 {
        size_t size;