mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-27 11:57:40 +00:00
Eliminate calls to sprintf
Apple Xcode has started giving `-Wdeprecated-declarations` warnings for `sprintf`, and suggesting that people migrate to `snprintf` instead. This is silly, but the warnings are spam and need to be silenced somehow. Migrating to `snprintf` and/or `hr::format` is the path of least resistance.
This commit is contained in:
5
help.cpp
5
help.cpp
@@ -586,8 +586,7 @@ EX string generateHelpForWall(eWall w) {
|
||||
void buteol(string& s, int current, int req) {
|
||||
int siz = isize(s);
|
||||
if(s[siz-1] == '\n') s.resize(siz-1);
|
||||
char buf[100]; sprintf(buf, " (%d/%d)", current, req);
|
||||
s += buf; s += "\n";
|
||||
s += hr::format(" (%d/%d)\n", current, req);
|
||||
}
|
||||
|
||||
EX string generateHelpForMonster(eMonster m) {
|
||||
@@ -930,7 +929,7 @@ EX void describeMouseover() {
|
||||
}
|
||||
|
||||
if(buggyGeneration) {
|
||||
char buf[80]; sprintf(buf, " %p H=%d M=%d", hr::voidp(c), c->landparam, c->mpdist); out += buf;
|
||||
out += hr::format(" %p H=%d M=%d", hr::voidp(c), c->landparam, c->mpdist);
|
||||
}
|
||||
|
||||
if(randomPatternsMode)
|
||||
|
||||
Reference in New Issue
Block a user