summaryrefslogtreecommitdiffstats
path: root/buffer.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2018-10-14 15:48:07 -0700
committerKevin McCarthy <kevin@8t8.us>2018-10-15 13:50:02 -0700
commit4781461ce08f0bf97e78467aceb883a0a27053e8 (patch)
tree04a148b0ce463162699aab623d770566816ef0de /buffer.c
parentb231f15a277027dbdc1e8f91b7e778384eb77f19 (diff)
Add rfc1524 buffer function interfaces for attach.c conversion.
The rfc1524 functions call, and are called by, many functions that need to be converted. But to keep the conversion manageable, install helper interface functions that pass the buffer->data and buffer->dsize in and adjust the buffer->dptr afterwards.
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 300b3582..109e4cb6 100644
--- a/buffer.c
+++ b/buffer.c
@@ -96,6 +96,18 @@ void mutt_buffer_increase_size (BUFFER *buf, size_t new_size)
}
}
+/* Ensure buffer->dptr points to the end of the buffer. */
+void mutt_buffer_fix_dptr (BUFFER *buf)
+{
+ buf->dptr = buf->data;
+
+ if (buf->data)
+ {
+ buf->data[buf->dsize - 1] = '\0';
+ buf->dptr = strchr (buf->data, '\0');
+ }
+}
+
static int _mutt_buffer_add_printf (BUFFER* buf, const char* fmt, va_list ap)
{
va_list ap_retry;