summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-05-30 16:15:01 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-05-31 00:32:07 +0200
commita5a2373979a9484bb68271e9c1c518f05a8ec564 (patch)
tree4e8491b003c76415baa40fc0556d3cbfe82f12e9 /source3/lib/util_str.c
parent8d639feed9493a099c57d494254f1ea262b28277 (diff)
downloadsamba-a5a2373979a9484bb68271e9c1c518f05a8ec564.tar.gz
s3-lib Move sstring_sub() to it's only user and make static
This should not be used more generally, as it is specifically not for multibyte strings, and uses malloc rather than talloc. Andrew Bartlett
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r--source3/lib/util_str.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 82d814ad9d9..5755fc99a07 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1143,33 +1143,6 @@ char *talloc_asprintf_strlower_m(TALLOC_CTX *t, const char *fmt, ...)
}
-/*
- Returns the substring from src between the first occurrence of
- the char "front" and the first occurence of the char "back".
- Mallocs the return string which must be freed. Not for use
- with wide character strings.
-*/
-char *sstring_sub(const char *src, char front, char back)
-{
- char *temp1, *temp2, *temp3;
- ptrdiff_t len;
-
- temp1 = strchr(src, front);
- if (temp1 == NULL) return NULL;
- temp2 = strchr(src, back);
- if (temp2 == NULL) return NULL;
- len = temp2 - temp1;
- if (len <= 0) return NULL;
- temp3 = (char*)SMB_MALLOC(len);
- if (temp3 == NULL) {
- DEBUG(1,("Malloc failure in sstring_sub\n"));
- return NULL;
- }
- memcpy(temp3, temp1+1, len-1);
- temp3[len-1] = '\0';
- return temp3;
-}
-
/********************************************************************
Check a string for any occurrences of a specified list of invalid
characters.