mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 09:21:26 +03:00
basic/format-table: remove parameter with constant value
This commit is contained in:
parent
21e4e3e06f
commit
cfc01c1e02
@ -882,8 +882,8 @@ static int table_data_requested_width(TableData *d, size_t *ret) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *align_string_mem(const char *str, size_t old_length, size_t new_length, unsigned percent) {
|
static char *align_string_mem(const char *str, size_t new_length, unsigned percent) {
|
||||||
size_t w = 0, space, lspace;
|
size_t w = 0, space, lspace, old_length;
|
||||||
const char *p;
|
const char *p;
|
||||||
char *ret;
|
char *ret;
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -893,7 +893,6 @@ static char *align_string_mem(const char *str, size_t old_length, size_t new_len
|
|||||||
assert(str);
|
assert(str);
|
||||||
assert(percent <= 100);
|
assert(percent <= 100);
|
||||||
|
|
||||||
if (old_length == (size_t) -1)
|
|
||||||
old_length = strlen(str);
|
old_length = strlen(str);
|
||||||
|
|
||||||
/* Determine current width on screen */
|
/* Determine current width on screen */
|
||||||
@ -1183,7 +1182,7 @@ int table_print(Table *t, FILE *f) {
|
|||||||
} else if (l < width[j]) {
|
} else if (l < width[j]) {
|
||||||
/* Field is shorter than allocated space. Let's align with spaces */
|
/* 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)
|
if (!buffer)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user