mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-23 18:07:41 +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:
@@ -26,15 +26,13 @@ string buildScoreDescription() {
|
||||
|
||||
for(int i=0; i<ittypes; i++) if(items[i]) {
|
||||
string t = XLATN(iinf[i].name);
|
||||
sprintf(buf2, " %s (%d)", t.c_str(), items[i]);
|
||||
s += buf2;
|
||||
s += hr::format(" %s (%d)", t.c_str(), items[i]);
|
||||
}
|
||||
s += "\n";
|
||||
s += XLAT("Kills: ") + its(tkills());
|
||||
for(int i=1; i<motypes; i++) if(kills[i]) {
|
||||
string t = XLATN(minf[i].name);
|
||||
sprintf(buf2, " %s (%d)", t.c_str(), kills[i]);
|
||||
s += buf2;
|
||||
s += hr::format(" %s (%d)", t.c_str(), kills[i]);
|
||||
}
|
||||
s += "\n";
|
||||
|
||||
|
Reference in New Issue
Block a user