From ff1bd6be03e2a0b12309b074dd0c13c6cc6c0ca6 Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Sat, 26 Jul 2025 03:07:34 +0200 Subject: output: minor improvements/corrections --- src/output.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/output.c b/src/output.c index daf16d3..644a6a6 100644 --- a/src/output.c +++ b/src/output.c @@ -120,7 +120,8 @@ inline size_t get_longest_filename(struct list_head *list) { inline void out_print_group_name(struct list_node *ptr) { struct group *group = NULL; static gid_t prev_gid = UINT32_MAX; - static char prev_group_name[64] = ""; + /* TODO: move to heap with sapconf(_SC_LOGIN_NAME_MAX) length */ + static char prev_group_name[256] = ""; size_t group_name_length = 0; /* For the unlikely case of multi threading this program: lock required here... */ @@ -158,7 +159,8 @@ inline void out_print_group_name(struct list_node *ptr) { inline void out_print_user_name(struct list_node *ptr) { struct passwd *pwd = NULL; static uid_t prev_uid = UINT32_MAX; - static char prev_user_name[64] = ""; + /* TODO: move to heap with sapconf(_SC_LOGIN_NAME_MAX) length */ + static char prev_user_name[256] = ""; size_t user_name_length = 0; /* For the unlikely case of multi threading this program: lock required here... */ @@ -388,9 +390,11 @@ inline void out_print_format_string_header(const char *format, size_t longest_fn switch (format[i]) { case 'n': sprintf(pos, " FILE "); - tmp = strlen(pos); - for (k=0; k