diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-27 13:23:20 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-27 13:23:20 +0000 |
commit | 7126d90fe0565292ef24bc7d7c0474f988f5f41f (patch) | |
tree | 33c09f550f3aa210902b171a007818772e381acf /crawl-ref/source/ouch.cc | |
parent | b7a932776480b974879b0e4de971c98bb90b8f0b (diff) | |
download | crawl-ref-7126d90fe0565292ef24bc7d7c0474f988f5f41f.tar.gz crawl-ref-7126d90fe0565292ef24bc7d7c0474f988f5f41f.zip |
Fixed hiscores buffer segfault madness.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@498 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r-- | crawl-ref/source/ouch.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 4cc78e65d8..f73f3c20da 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -891,15 +891,12 @@ void end_game( struct scorefile_entry &se ) cprintf( "Goodbye, %s.", you.your_name ); cprintf( EOL EOL " " ); // Space padding where # would go in list format - char scorebuff[ HIGHSCORE_SIZE ]; - hiscores_format_single_long( scorebuff, se, true ); - // truncate - scorebuff[ HIGHSCORE_SIZE - 1 ] = 0; + std::string hiscore = hiscores_format_single_long( se, true ); - const int lines = count_occurrences(scorebuff, EOL) + 1; + const int lines = count_occurrences(hiscore, EOL) + 1; - cprintf( scorebuff ); + cprintf( "%s", hiscore.c_str() ); cprintf( EOL "Best Crawlers -" EOL ); |