Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
Test char text[2048]
Browse files Browse the repository at this point in the history
  • Loading branch information
TYHH10 authored and TYHH10 committed Jul 8, 2024
1 parent 5e5d712 commit 70f43af
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions src/concolor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ namespace ColorSpew
{
int c = map_ANSI16.Map(*GetSpewOutputColor());

char text[512];
char text[2048];
if (c < 8) {
snprintf(text, 512, "\e[%dm" "%s" "\e[0m", 30 + c, pMsg);
snprintf(text, 2048, "\e[%dm" "%s" "\e[0m", 30 + c, pMsg);
} else {
snprintf(text, 512, "\e[%d;1m" "%s" "\e[0m", 30 + (c - 8), pMsg);
snprintf(text, 2048, "\e[%d;1m" "%s" "\e[0m", 30 + (c - 8), pMsg);
}

return s_SpewOutputBackup(type, pMsg);
Expand All @@ -218,8 +218,8 @@ namespace ColorSpew
{
int c = map_ANSI256.Map(*GetSpewOutputColor());

char text[512];
snprintf(text, 512, "\e[38;2;%dm" "%s" "\e[0m", 16 + c, pMsg);
char text[2048];
snprintf(text, 2048, "\e[38;2;%dm" "%s" "\e[0m", 16 + c, pMsg);

return s_SpewOutputBackup(type, pMsg);
}
Expand All @@ -229,8 +229,8 @@ namespace ColorSpew
{
Color c = *GetSpewOutputColor();

char text[512];
snprintf(text, 512, "\e[38;2;%d;%d;%dm" "%s" "\e[0m", c.r(), c.g(), c.b(), pMsg);
char text[2048];
snprintf(text, 2048, "\e[38;2;%d;%d;%dm" "%s" "\e[0m", c.r(), c.g(), c.b(), pMsg);

return s_SpewOutputBackup(type, text);
}
Expand Down
12 changes: 6 additions & 6 deletions src/mod/mvm/extended_upgrades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,12 +1182,12 @@ namespace Mod::MvM::Extended_Upgrades

if (enabled) {

char text[512];
char text[2048];
if (upgrade->increment != 0 && max_step < 100000 ) {
snprintf(text, 512, "%s (%d/%d) $%d", upgrade->name.c_str(), cur_step, max_step, upgrade->cost);
snprintf(text, 2048, "%s (%d/%d) $%d", upgrade->name.c_str(), cur_step, max_step, upgrade->cost);
}
else { // If increment == 0 or max steps less than 100000, pretend unlimited upgrades
snprintf(text, 512, "%s $%d", upgrade->name.c_str(), upgrade->cost);
snprintf(text, 2048, "%s $%d", upgrade->name.c_str(), upgrade->cost);
}

ItemDrawInfo info1(text,
Expand All @@ -1209,12 +1209,12 @@ namespace Mod::MvM::Extended_Upgrades
}
else if (upgrade->show_requirements && disabled_reason != "") {

char text[512];
char text[2048];
if (upgrade->increment != 0 && max_step < 100000) {
snprintf(text, 512, "%s: %s (%d/%d) $%d", upgrade->name.c_str(), disabled_reason.c_str(), cur_step, max_step, upgrade->cost);
snprintf(text, 2048, "%s: %s (%d/%d) $%d", upgrade->name.c_str(), disabled_reason.c_str(), cur_step, max_step, upgrade->cost);
}
else { // If increment == 0 or max steps less than 100000, pretend unlimited upgrades
snprintf(text, 512, "%s: %s $%d", upgrade->name.c_str(), disabled_reason.c_str(), upgrade->cost);
snprintf(text, 2048, "%s: %s $%d", upgrade->name.c_str(), disabled_reason.c_str(), upgrade->cost);
}

ItemDrawInfo info1(text, ITEMDRAW_DISABLED);
Expand Down
4 changes: 2 additions & 2 deletions src/mod/pop/popmgr_extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4246,8 +4246,8 @@ namespace Mod::Pop::PopMgr_Extensions

if (item.allow_refund) {
char buf[256];
snprintf(buf, sizeof(buf), " ($%d)", item.cost);
ItemDrawInfo info2("", ITEMDRAW_DEFAULT);
snprintf(buf, sizeof(buf), "售出 ($%d)", item.cost);
ItemDrawInfo info2("售出", ITEMDRAW_DEFAULT);
menu->AppendItem("Sell", info2);
}
}
Expand Down

0 comments on commit 70f43af

Please sign in to comment.