From 4cdd5f8ccc528cf193b423bdc410d8480710c492 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 5 May 2022 18:50:15 +0200 Subject: [PATCH] Export tabstospaces() from conf.c to helpers.[ch] Signed-off-by: Joachim Wiberg --- src/conf.c | 11 ----------- src/helpers.c | 11 +++++++++++ src/helpers.h | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/conf.c b/src/conf.c index af7a0712..50923933 100644 --- a/src/conf.c +++ b/src/conf.c @@ -755,17 +755,6 @@ static int parse_dynamic(char *line, struct rlimit rlimit[], char *file) return 1; } -static void tabstospaces(char *line) -{ - if (!line) - return; - - for (int i = 0; line[i]; i++) { - if (line[i] == '\t') - line[i] = ' '; - } -} - static int parse_conf(char *file, int is_rcsd) { struct rlimit rlimit[RLIMIT_NLIMITS]; diff --git a/src/helpers.c b/src/helpers.c index 7d23ab21..5ffc04a3 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -102,6 +102,17 @@ ssize_t cprintf(const char *fmt, ...) return size; } +void tabstospaces(char *line) +{ + if (!line) + return; + + for (int i = 0; line[i]; i++) { + if (line[i] == '\t') + line[i] = ' '; + } +} + char *strip_line(char *line) { char *ptr; diff --git a/src/helpers.h b/src/helpers.h index ecc239cf..c8deb2f9 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -49,6 +49,7 @@ char *console (void); void console_init (void); ssize_t cprintf (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +void tabstospaces (char *line); char *strip_line (char *line); void enable_progress (int onoff);