From efc210d5208a2da1fc33c7ebd745bf806dd26f62 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 9 Feb 2012 12:49:45 +1100 Subject: lib/util: Remove unused str_format_nbt_domain() Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html Andrew Bartlett --- lib/util/samba_util.h | 6 ------ lib/util/util_str.c | 35 ----------------------------------- 2 files changed, 41 deletions(-) (limited to 'lib') diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h index 5ce2e5e535..8e8e7c1abd 100644 --- a/lib/util/samba_util.h +++ b/lib/util/samba_util.h @@ -333,12 +333,6 @@ _PUBLIC_ char *rfc1738_escape_unescaped(TALLOC_CTX *mem_ctx, const char *url); **/ _PUBLIC_ char *rfc1738_escape_part(TALLOC_CTX *mem_ctx, const char *url); -/** - format a string into length-prefixed dotted domain format, as used in NBT - and in some ADS structures -**/ -_PUBLIC_ const char *str_format_nbt_domain(TALLOC_CTX *mem_ctx, const char *s); - /** * Add a string to an array of strings. * diff --git a/lib/util/util_str.c b/lib/util/util_str.c index 388d7887ef..9379304cfb 100644 --- a/lib/util/util_str.c +++ b/lib/util/util_str.c @@ -31,41 +31,6 @@ * @brief String utilities. **/ -/** - format a string into length-prefixed dotted domain format, as used in NBT - and in some ADS structures -**/ -_PUBLIC_ const char *str_format_nbt_domain(TALLOC_CTX *mem_ctx, const char *s) -{ - char *ret; - int i; - if (!s || !*s) { - return talloc_strdup(mem_ctx, ""); - } - ret = talloc_array(mem_ctx, char, strlen(s)+2); - if (!ret) { - return ret; - } - - memcpy(ret+1, s, strlen(s)+1); - ret[0] = '.'; - - for (i=0;ret[i];i++) { - if (ret[i] == '.') { - char *p = strchr(ret+i+1, '.'); - if (p) { - ret[i] = p-(ret+i+1); - } else { - ret[i] = strlen(ret+i+1); - } - } - } - - talloc_set_name_const(ret, ret); - - return ret; -} - /** * Parse a string containing a boolean value. * -- cgit