Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
histogram could crash if value inserted equalled max value.

don't escape * in server description
  • Loading branch information
tra committed Feb 19, 2025
1 parent 65bdd7f commit fb75f26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/game/CAvaraApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ void CAvaraAppImpl::TrackerUpdate() {
std::string gitv = std::string(GIT_VERSION);
trackerState["version"]["git"] = gitv;
trackerState["version"]["net"] = kAvaraNetVersion;
trackerState["description"] = gitv.substr(0, 6) + (gitv.length() > 8 ? "\\*: " : ": ") + String(kServerDescription);
trackerState["description"] = gitv.substr(0, 6) + (gitv.length() > 8 ? "*: " : ": ") + String(kServerDescription);
trackerState["password"] = String(kServerPassword).length() > 0 ? true : false;

DBG_Log("tracker", "%s", trackerState.dump().c_str());
Expand Down
2 changes: 1 addition & 1 deletion src/util/SlidingHistogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SlidingHistogram {
std::size_t idx;
if (value < minValue) {
idx = 0;
} else if (value > maxValue) {
} else if (value >= maxValue) {
idx = cellCounts.size() - 1;
} else {
idx = (value - minValue) / stepSize;
Expand Down

0 comments on commit fb75f26

Please sign in to comment.