]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Remove unused asubst function
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Thu, 31 May 2018 14:01:41 +0000 (16:01 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Thu, 31 May 2018 14:01:41 +0000 (16:01 +0200)
src/daemon/utils_subst.c
src/daemon/utils_subst.h

index 546ca186f812fd4b5a672b20b0340d4e4bb4b039..28924e449f37564e2cf8a2b2074cbf992be8ef78 100644 (file)
@@ -90,28 +90,6 @@ char *subst(char *buf, size_t buflen, const char *string, size_t off1,
   return buf;
 } /* subst */
 
-char *asubst(const char *string, int off1, int off2, const char *replacement) {
-  char *buf;
-  int len;
-
-  char *ret;
-
-  if ((NULL == string) || (0 > off1) || (0 > off2) || (off1 > off2) ||
-      (NULL == replacement))
-    return NULL;
-
-  len = off1 + strlen(replacement) + strlen(string) - off2 + 1;
-
-  buf = malloc(len);
-  if (NULL == buf)
-    return NULL;
-
-  ret = subst(buf, len, string, off1, off2, replacement);
-  if (NULL == ret)
-    free(buf);
-  return ret;
-} /* asubst */
-
 char *subst_string(char *buf, size_t buflen, const char *string,
                    const char *needle, const char *replacement) {
   size_t needle_len;
index a10b258902d3e4b0c61c34b30e3049508e415a34..7807555cc09f3a5c52703a0668a99a7f3620894e 100644 (file)
 char *subst(char *buf, size_t buflen, const char *string, size_t off1,
             size_t off2, const char *replacement);
 
-/*
- * asubst:
- *
- * This function is very similar to subst(). It differs in that it
- * automatically allocates the memory required for the return value which the
- * user then has to free himself.
- *
- * Returns the newly allocated result string on success, NULL else.
- */
-char *asubst(const char *string, int off1, int off2, const char *replacement);
-
 /*
  * subst_string:
  *