summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsmartcols/src/buffer.c')
-rw-r--r--libsmartcols/src/buffer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libsmartcols/src/buffer.c b/libsmartcols/src/buffer.c
index 46f270d1f..20953a5dc 100644
--- a/libsmartcols/src/buffer.c
+++ b/libsmartcols/src/buffer.c
@@ -67,6 +67,18 @@ int buffer_append_data(struct libscols_buffer *buf, const char *str)
return 0;
}
+int buffer_append_ntimes(struct libscols_buffer *buf, size_t n, const char *str)
+{
+ size_t i;
+
+ for (i = 0; i < n; i++) {
+ int rc = buffer_append_data(buf, str);
+ if (rc)
+ return rc;
+ }
+ return 0;
+}
+
int buffer_set_data(struct libscols_buffer *buf, const char *str)
{
int rc = buffer_reset_data(buf);