]> granicus.if.org Git - mutt/commitdiff
Add mutt_buffer_addstr_n().
authorKevin McCarthy <kevin@8t8.us>
Mon, 3 Dec 2018 04:26:27 +0000 (20:26 -0800)
committerKevin McCarthy <kevin@8t8.us>
Mon, 3 Dec 2018 21:50:11 +0000 (13:50 -0800)
buffer.c
buffer.h

index 3142d00c05d0a598348c9bebd09fb35a98a66351..3e0b78f47e20f20cb5fcc506500d455c1f59ccfe 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -172,7 +172,7 @@ int mutt_buffer_add_printf (BUFFER* buf, const char* fmt, ...)
 /* Dynamically grows a BUFFER to accommodate s, in increments of 128 bytes.
  * Always one byte bigger than necessary for the null terminator, and
  * the buffer is always null-terminated */
-static void mutt_buffer_add (BUFFER* buf, const char* s, size_t len)
+void mutt_buffer_addstr_n (BUFFER* buf, const char* s, size_t len)
 {
   if (buf->dptr + len + 1 > buf->data + buf->dsize)
     mutt_buffer_increase_size (buf, buf->dsize + (len < 128 ? 128 : len + 1));
@@ -183,12 +183,12 @@ static void mutt_buffer_add (BUFFER* buf, const char* s, size_t len)
 
 void mutt_buffer_addstr (BUFFER* buf, const char* s)
 {
-  mutt_buffer_add (buf, s, mutt_strlen (s));
+  mutt_buffer_addstr_n (buf, s, mutt_strlen (s));
 }
 
 void mutt_buffer_addch (BUFFER* buf, char c)
 {
-  mutt_buffer_add (buf, &c, 1);
+  mutt_buffer_addstr_n (buf, &c, 1);
 }
 
 void mutt_buffer_strcpy (BUFFER *buf, const char *s)
index 3312ad866b028a86fa5d7eabce81b2eaaa5886fd..fae26d34c938649bcf904b93c1d8b65d20fc0bec 100644 (file)
--- a/buffer.h
+++ b/buffer.h
@@ -47,6 +47,7 @@ void mutt_buffer_strcpy (BUFFER *, const char *);
 
 /* These append to the buffer. */
 int mutt_buffer_add_printf (BUFFER*, const char*, ...);
+void mutt_buffer_addstr_n (BUFFER*, const char*, size_t);
 void mutt_buffer_addstr (BUFFER*, const char*);
 void mutt_buffer_addch (BUFFER*, char);