prevent overflow in win_bar
This commit is contained in:
parent
ed41a14d36
commit
b4b748c042
@ -345,6 +345,8 @@ void win_bar(StInt *st, bool use_color) {
|
|||||||
int yellow = (75 * bar_width) / 100;
|
int yellow = (75 * bar_width) / 100;
|
||||||
int red = (90 * bar_width) / 100;
|
int red = (90 * bar_width) / 100;
|
||||||
|
|
||||||
|
if (filled > bar_width) filled = bar_width;
|
||||||
|
|
||||||
for (int y = 1; y <= bar_height; y++) {
|
for (int y = 1; y <= bar_height; y++) {
|
||||||
for (int x = 0; x < filled; x++) {
|
for (int x = 0; x < filled; x++) {
|
||||||
if (use_color) {
|
if (use_color) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user