1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-10 06:16:00 +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:
Arthur O'Dwyer
2023-08-21 10:14:19 -07:00
parent ced3bbcad4
commit 10d0ed8900
11 changed files with 22 additions and 39 deletions

View File

@@ -27,9 +27,7 @@ EX int getgametime() {
}
EX string getgametime_s(int timespent IS(getgametime())) {
char buf[20];
sprintf(buf, "%d:%02d", timespent/60, timespent % 60);
return buf;
return hr::format("%d:%02d", timespent/60, timespent % 60);
}
EX bool display_yasc_codes;