few tweaks about changed defines.
[apps/madmutt.git] / lib-lib / buffer.h
index a4d1912..dd9d936 100644 (file)
@@ -86,6 +86,13 @@ static inline void buffer_addch(buffer_t *buf, int c) {
     buffer_extendch(buf, 1, c);
 }
 
+static inline void buffer_reset(buffer_t *buf) {
+    if (buf->len) {
+        buf->len = 0;
+        buf->data[0] = '\0';
+    }
+}
+
 
 /****** LEGACY BUFFERS *******/