summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-03-10 09:58:07 +0800
committerKevin McCarthy <kevin@8t8.us>2019-03-10 09:58:07 +0800
commit5be5ad46119377f425181d3079c5700ef4bd33e0 (patch)
tree114baec9b21ba2bea2f7cd24ebadb474c5a8ee5c /init.c
parente548343453c330ca27e86d0b53612b9c1c232c1a (diff)
Minor buffer handling code cleanup.
Use mutt_buffer_len() and mutt_buffer_clear() to make the code a bit clearer. There are still places in the code that manipulate the buffers directly (pattern.c, for example), but that doesn't mean we shouldn't abstract the buffer where we can. Add comments in a couple places where unusual buffer manipulation is occurring.
Diffstat (limited to 'init.c')
-rw-r--r--init.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/init.c b/init.c
index fe75c2db..387fde15 100644
--- a/init.c
+++ b/init.c
@@ -140,8 +140,7 @@ int mutt_extract_token (BUFFER *dest, BUFFER *tok, int flags)
char qc = 0; /* quote char */
char *pc;
- /* reset the destination pointer to the beginning of the buffer */
- dest->dptr = dest->data;
+ mutt_buffer_clear (dest);
SKIPWS (tok->dptr);
while ((ch = *tok->dptr))
@@ -3406,9 +3405,7 @@ void mutt_init (int skip_sys_rc, LIST *commands)
BUFFER err;
mutt_buffer_init (&err);
- err.dsize = STRING;
- err.data = safe_malloc(err.dsize);
- err.dptr = err.data;
+ mutt_buffer_increase_size (&err, STRING);
Groups = hash_create (1031, 0);
/* reverse alias keys need to be strdup'ed because of idna conversions */