1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
This commit is contained in:
Steffen Vogel 2017-09-16 15:33:30 +02:00
parent fba30731aa
commit 7def6349d5
2 changed files with 8 additions and 4 deletions

View file

@ -118,7 +118,9 @@ static void log_resize(int signal, siginfo_t *sinfo, void *ctx)
if (ret)
return;
global_log->width = global_log->window.ws_col - 25 - strlenp(global_log->prefix);
global_log->width = global_log->window.ws_col - 25;
if (global_log->prefix)
global_log->width -= strlenp(global_log->prefix);
debug(LOG_LOG | 15, "New terminal size: %dx%x", global_log->window.ws_row, global_log->window.ws_col);
}
@ -161,7 +163,9 @@ int log_init(struct log *l, int level, long facilitites)
l->window.ws_row = LOG_HEIGHT;
}
l->width = l->window.ws_col - 25 - strlenp(l->prefix);
l->width = l->window.ws_col - 25;
if (l->prefix)
l->width -= strlenp(l->prefix);
l->state = STATE_INITIALIZED;

View file

@ -170,7 +170,7 @@ ParameterizedTest(char *fmt, io, lowlevel)
f = io_format_lookup(fmt);
cr_assert_not_null(f, "Format '%s' does not exist", fmt);
ret = io_format_sprint(f, buf, sizeof(buf), &wbytes, smps, NUM_SAMPLES, SAMPLE_ALL);
ret = io_format_sprint(f, buf, sizeof(buf), &wbytes, smps, NUM_SAMPLES, SAMPLE_HAS_ALL);
cr_assert_eq(ret, NUM_SAMPLES);
ret = io_format_sscan(f, buf, wbytes, &rbytes, smpt, NUM_SAMPLES, 0);
@ -218,7 +218,7 @@ ParameterizedTest(char *fmt, io, highlevel)
f = io_format_lookup(fmt);
cr_assert_not_null(f, "Format '%s' does not exist", fmt);
ret = io_init(&io, f, SAMPLE_ALL);
ret = io_init(&io, f, SAMPLE_HAS_ALL);
cr_assert_eq(ret, 0);
ret = io_open(&io, fn);