diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-12-26 11:00:19 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-12-26 11:00:19 -0500 |
commit | 115076941358f58e13b9a8e79840fa741f70a84f (patch) | |
tree | b8d5d59c9f467fb264c6e3bc402aba4c4c898fec /src/strings.c | |
parent | b7e55876614b1c55bb4e9cf58003de61c1dd8932 (diff) | |
download | spmc-115076941358f58e13b9a8e79840fa741f70a84f.tar.gz |
Listing packages and printing banners
Diffstat (limited to 'src/strings.c')
-rw-r--r-- | src/strings.c | 18 |
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'); +} |