summaryrefslogtreecommitdiff
path: root/src/squeltch.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2017-05-02 19:20:57 +0200
committerBardur Arantsson <bardur@scientician.net>2017-05-02 19:20:57 +0200
commita40a0d1aeddb4742e486f601cbcc7e9ddcc06e2d (patch)
treeda5e8653050f47fc68f14d0062c11273774688e5 /src/squeltch.cc
parentc2ff640e5540fd4c55dd054ae87dd510a11155e9 (diff)
Move player_{name,base} to Game
Diffstat (limited to 'src/squeltch.cc')
-rw-r--r--src/squeltch.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/squeltch.cc b/src/squeltch.cc
index 747c6beb..8d2db53a 100644
--- a/src/squeltch.cc
+++ b/src/squeltch.cc
@@ -33,6 +33,7 @@
#include <algorithm>
#include <deque>
+#include <fmt/format.h>
#include <list>
#include <memory>
#include <string>
@@ -170,16 +171,15 @@ static int create_new_rule()
static void automatizer_save_rules()
{
- char name[30] = { '\0' };
char buf[1025];
char ch;
int hgt, wid;
Term_get_size(&wid, &hgt);
- sprintf(name, "%s.atm", player_name);
+ std::string name = fmt::format("{}.atm", game->player_name);
- if (!input_box("Save name?", hgt / 2, wid / 2, name, sizeof(name)))
+ if (!input_box("Save name?", hgt / 2, wid / 2, &name, 30))
{
return;
}
@@ -201,7 +201,7 @@ static void automatizer_save_rules()
};
// Build the filename
- path_build(buf, 1024, ANGBAND_DIR_USER, name);
+ path_build(buf, 1024, ANGBAND_DIR_USER, name.c_str());
if (file_exist(buf))
{