diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-11-29 19:10:40 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-11-30 18:41:03 -0800 |
commit | 20334587eac86b5c7753a908c16aa35c0d7762eb (patch) | |
tree | 7dc31d1c45b558efc117c222bd62f9e80371f320 /buffer.c | |
parent | e1c962aadc55c74d4f6aac31e120e81c8fd511cc (diff) |
Add mutt_buffer_rewind() function.
This makes it a bit clearer what the assignment is doing, and reduces
direct dptr manipulation a bit.
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -67,6 +67,15 @@ void mutt_buffer_clear (BUFFER *b) *(b->dptr) = '\0'; } +/* This is used for cases where the buffer is read from. + * A value is placed in the buffer, and then b->dptr is set back to the + * beginning as a read marker instead of write marker. + */ +void mutt_buffer_rewind (BUFFER *b) +{ + b->dptr = b->data; +} + /* Creates and initializes a BUFFER by copying the seed string. */ BUFFER *mutt_buffer_from (char *seed) { |