Ensure the dynamic segment width never tries to go negative.

This commit is contained in:
Andrew Wood
2024-12-22 00:21:34 +00:00
parent 0f08153214
commit 5decddeb42
+3 -1
View File
@@ -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