aboutsummaryrefslogtreecommitdiff
path: root/src/strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings.c')
-rw-r--r--src/strings.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/strings.c b/src/strings.c
index e50daeb..38cc4d3 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -503,3 +503,21 @@ int isrelational(char ch) {
}
return 0;
}
+
+/**
+ * Repeatedly print string `s`, `len` times
+ * @param s
+ * @param len
+ */
+void print_banner(const char *s, int len) {
+ size_t s_len = strlen(s);
+ if (!s || !s_len) {
+ return;
+ }
+ for (int i = 0; i < (len / s_len); i++) {
+ for (int c = 0; c < s_len; c++) {
+ putchar(s[c]);
+ }
+ }
+ putchar('\n');
+}