From 6bbd3e9e43fddca75b87d5bca1fc1a37faf87357 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 24 Oct 2009 16:26:48 +0200 Subject: Convert player::your_name to std::string. Doesn't seem to break anything... --- crawl-ref/source/acr.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/acr.cc') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 9873519f4c..59294d07f9 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1925,11 +1925,7 @@ void process_command( command_type cmd ) break; case CMD_CHARACTER_DUMP: - char name_your[kNameLen+1]; - - strncpy(name_your, you.your_name, kNameLen); - name_your[kNameLen] = 0; - if (dump_char( name_your, false )) + if (dump_char(you.your_name, false)) mpr("Char dumped successfully."); else mpr("Char dump unsuccessful! Sorry about that."); @@ -3611,11 +3607,10 @@ static bool _initialise(void) #ifdef CLUA_BINDINGS clua.runhook("chk_startgame", "b", newc); - std::string yname = you.your_name; + std::string yname = you.your_name; // XXX: what's this for? read_init_file(true); Options.fixup_options(); - strncpy(you.your_name, yname.c_str(), kNameLen); - you.your_name[kNameLen - 1] = 0; + you.your_name = yname; // In case Lua changed the character set. init_char_table(Options.char_set); -- cgit v1.2.3-54-g00ecf