From: Volker Lendecke Date: Thu, 27 Jun 2024 15:54:01 +0000 (+0200) Subject: lib: Remove unused strnrchr_m X-Git-Tag: tdb-1.4.11~189 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f31478e782ff28619f16be7dd95bf9d0f64f7d10;p=thirdparty%2Fsamba.git lib: Remove unused strnrchr_m Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- diff --git a/source3/include/proto.h b/source3/include/proto.h index bd7efce1f39..473407016aa 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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); diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 1591420587e..7c7872d6809 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -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;