summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-06-11 09:57:05 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commitdad68a6342f86f817e07187ea06b44d2f0c90321 (patch)
treeb9684fc416a432aea86b38b35c0a7a61ffedec63 /src
parent1b10c04c333e0c1e5c6e373d55f2564db728ed25 (diff)
basic/format-table: remove parameter with constant value
Diffstat (limited to 'src')
-rw-r--r--src/basic/format-table.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/basic/format-table.c b/src/basic/format-table.c
index fe7c35193..8340133be 100644
--- a/src/basic/format-table.c
+++ b/src/basic/format-table.c
@@ -882,8 +882,8 @@ static int table_data_requested_width(TableData *d, size_t *ret) {
return 0;
}
-static char *align_string_mem(const char *str, size_t old_length, size_t new_length, unsigned percent) {
- size_t w = 0, space, lspace;
+static char *align_string_mem(const char *str, size_t new_length, unsigned percent) {
+ size_t w = 0, space, lspace, old_length;
const char *p;
char *ret;
size_t i;
@@ -893,8 +893,7 @@ static char *align_string_mem(const char *str, size_t old_length, size_t new_len
assert(str);
assert(percent <= 100);
- if (old_length == (size_t) -1)
- old_length = strlen(str);
+ old_length = strlen(str);
/* Determine current width on screen */
p = str;
@@ -1183,7 +1182,7 @@ int table_print(Table *t, FILE *f) {
} else if (l < width[j]) {
/* Field is shorter than allocated space. Let's align with spaces */
- buffer = align_string_mem(field, (size_t) -1, width[j], d->align_percent);
+ buffer = align_string_mem(field, width[j], d->align_percent);
if (!buffer)
return -ENOMEM;