aboutsummaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
authorThorsten Töpper <atsutane@freethoughts.de>2025-07-26 02:28:21 +0200
committerThorsten Töpper <atsutane@freethoughts.de>2025-07-26 02:28:21 +0200
commit7b61889b4e599ebfe95ca91bb8712a9e659ab3fa (patch)
treed447c52a6ba37ee19f83401bd69c99c26be891b8 /src/output.c
parentc59f8e70b3240ff9117176b8dce6115e6b8c80e5 (diff)
downloaddir_monitor-7b61889b4e599ebfe95ca91bb8712a9e659ab3fa.tar.gz
dir_monitor-7b61889b4e599ebfe95ca91bb8712a9e659ab3fa.tar.bz2
output: max UID is signed 32bit -> more buffer
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/output.c b/src/output.c
index 1c3678d..daf16d3 100644
--- a/src/output.c
+++ b/src/output.c
@@ -337,8 +337,8 @@ inline size_t estimate_formatted_line_length(const char *format, size_t longest_
case 'G':
case 'U': rc += ((unsigned int)login_name_max); break;
case 'g': /* Short ones */
- case 'p':
- case 'u': rc += 8; break;
+ case 'u': rc += 14; break;
+ case 'p': rc += 8; break;
case ' ': break;
default: rc += 28; /* time, and strings >10 in format*/
};
@@ -358,7 +358,7 @@ inline void out_print_format_string_header(const char *format, size_t longest_fn
format_len = strnlen(format, DM_OUT_FORMAT_MAX_LEN);
est_length = estimate_formatted_line_length(format, longest_fname);
- if ((header=calloc(est_length, sizeof(char))) == NULL) {
+ if ((header=calloc(est_length+1, sizeof(char))) == NULL) {
LOGERR("ERROR: Failed to allocate memory for header\n");
return;
}
@@ -366,7 +366,7 @@ inline void out_print_format_string_header(const char *format, size_t longest_fn
pos = header;
if (option_print_boxed_table) {
- if ((sep_line=calloc(est_length, sizeof(char))) == NULL) {
+ if ((sep_line=calloc(est_length+1, sizeof(char))) == NULL) {
free(header);
LOGERR("ERROR: Failed to allocate memory for sep line\n");
return;