CLEANUP: kill buffer_replace() and use an inline instead

This function is never used, only its buffer_replace2() alternative
is used. Replace the former with an inline which calls the later.
diff --git a/include/proto/buffers.h b/include/proto/buffers.h
index 0d395a0..f0ea83d 100644
--- a/include/proto/buffers.h
+++ b/include/proto/buffers.h
@@ -45,7 +45,6 @@
 int buffer_put_char(struct buffer *buf, char c);
 int buffer_get_line(struct buffer *buf, char *str, int len);
 int buffer_get_block(struct buffer *buf, char *blk, int len, int offset);
-int buffer_replace(struct buffer *b, char *pos, char *end, const char *str);
 int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int len);
 int buffer_insert_line2(struct buffer *b, char *pos, const char *str, int len);
 void buffer_dump(FILE *o, struct buffer *b, int from, int to);
@@ -575,6 +574,19 @@
 	return -2;
 }
 
+
+/* This function writes the string <str> at position <pos> which must be in
+ * buffer <b>, and moves <end> just after the end of <str>. <b>'s parameters
+ * (l, r, lr) are updated to be valid after the shift. the shift value
+ * (positive or negative) is returned. If there's no space left, the move is
+ * not done. The function does not adjust ->send_max nor BF_OUT_EMPTY because
+ * it does not make sense to use it on data scheduled to be sent.
+ */
+static inline int buffer_replace(struct buffer *b, char *pos, char *end, const char *str)
+{
+	return buffer_replace2(b, pos, end, str, strlen(str));
+}
+
 /*
  *
  * Functions below are used to manage chunks
diff --git a/src/buffers.c b/src/buffers.c
index 43c0647..88d40ff 100644
--- a/src/buffers.c
+++ b/src/buffers.c
@@ -316,53 +316,14 @@
 	return len;
 }
 
-/*
- * this function writes the string <str> at position <pos> which must be in buffer <b>,
- * and moves <end> just after the end of <str>.
- * <b>'s parameters (l, r, lr) are recomputed to be valid after the shift.
- * the shift value (positive or negative) is returned.
- * If there's no space left, the move is not done.
- * The function does not adjust ->send_max nor BF_OUT_EMPTY because it does not
- * make sense to use it on data scheduled to be sent.
- *
- */
-int buffer_replace(struct buffer *b, char *pos, char *end, const char *str)
-{
-	int delta;
-	int len;
-
-	len = strlen(str);
-	delta = len - (end - pos);
-
-	if (delta + b->r >= b->data + b->size)
-		return 0;  /* no space left */
-
-	if (delta + b->r > b->w && b->w >= b->r && b->l)
-		return 0;  /* no space left before wrapping data */
-
-	/* first, protect the end of the buffer */
-	memmove(end + delta, end, b->r - end);
-
-	/* now, copy str over pos */
-	memcpy(pos, str,len);
-
-	/* we only move data after the displaced zone */
-	if (b->r  > pos) b->r  += delta;
-	if (b->lr > pos) b->lr += delta;
-	b->l += delta;
-
-	b->flags &= ~BF_FULL;
-	if (b->l == 0)
-		b->r = b->w = b->lr = b->data;
-	if (b->l >= buffer_max_len(b))
-		b->flags |= BF_FULL;
-
-	return delta;
-}
-
-/*
- * same except that the string length is given, which allows str to be NULL if
- * len is 0. The send limit is *not* adjusted.
+/* This function writes the string <str> at position <pos> which must be in
+ * buffer <b>, and moves <end> just after the end of <str>. <b>'s parameters
+ * (l, r, lr) are updated to be valid after the shift. the shift value
+ * (positive or negative) is returned. If there's no space left, the move is
+ * not done. The function does not adjust ->send_max nor BF_OUT_EMPTY because
+ * it does not make sense to use it on data scheduled to be sent. The string
+ * length is taken from parameter <len>. If <len> is null, the <str> pointer
+ * is allowed to be null.
  */
 int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int len)
 {
@@ -397,7 +358,6 @@
 	return delta;
 }
 
-
 /*
  * Inserts <str> followed by "\r\n" at position <pos> in buffer <b>. The <len>
  * argument informs about the length of string <str> so that we don't have to