Skip to content

Commit cfc01c1

Browse files
committed
basic/format-table: remove parameter with constant value
1 parent 21e4e3e commit cfc01c1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/basic/format-table.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,8 @@ static int table_data_requested_width(TableData *d, size_t *ret) {
882882
return 0;
883883
}
884884

885-
static char *align_string_mem(const char *str, size_t old_length, size_t new_length, unsigned percent) {
886-
size_t w = 0, space, lspace;
885+
static char *align_string_mem(const char *str, size_t new_length, unsigned percent) {
886+
size_t w = 0, space, lspace, old_length;
887887
const char *p;
888888
char *ret;
889889
size_t i;
@@ -893,8 +893,7 @@ static char *align_string_mem(const char *str, size_t old_length, size_t new_len
893893
assert(str);
894894
assert(percent <= 100);
895895

896-
if (old_length == (size_t) -1)
897-
old_length = strlen(str);
896+
old_length = strlen(str);
898897

899898
/* Determine current width on screen */
900899
p = str;
@@ -1183,7 +1182,7 @@ int table_print(Table *t, FILE *f) {
11831182
} else if (l < width[j]) {
11841183
/* Field is shorter than allocated space. Let's align with spaces */
11851184

1186-
buffer = align_string_mem(field, (size_t) -1, width[j], d->align_percent);
1185+
buffer = align_string_mem(field, width[j], d->align_percent);
11871186
if (!buffer)
11881187
return -ENOMEM;
11891188

0 commit comments

Comments
 (0)