From 5decddeb42acd1c01349a0290ec629f37ef72f46 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 22 Dec 2024 00:21:34 +0000 Subject: [PATCH] Ensure the dynamic segment width never tries to go negative. --- src/pv/display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pv/display.c b/src/pv/display.c index aff8cbb..eddb126 100644 --- a/src/pv/display.c +++ b/src/pv/display.c @@ -1138,7 +1138,9 @@ bool pv_format(pvstate_t state, /*@null@ */ const char *format_supplied, pvdispl * with a dynamic width. */ - dynamic_segment_width = state->control.width - static_portion_width; + dynamic_segment_width = 0; + if (state->control.width > static_portion_width) + dynamic_segment_width = state->control.width - static_portion_width; /* * Divide the total remaining screen space by the number of dynamic