summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ng-input.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2010-12-04 12:48:38 +0100
committerAdam Borowski <kilobyte@angband.pl>2010-12-04 12:48:38 +0100
commit59ff4a95deac5fc4458efe5818edc76fcf464df7 (patch)
treef9fb0b3f7d2e061d82fbe80e6e821f6127b46e2f /crawl-ref/source/ng-input.cc
parent79ee111e399be376d3f728db3fd45d4930453c32 (diff)
downloadcrawl-ref-59ff4a95deac5fc4458efe5818edc76fcf464df7.tar.gz
crawl-ref-59ff4a95deac5fc4458efe5818edc76fcf464df7.zip
Fix two off-by-one bugs for player's name length.
Ghosts would be ignored with names just at max.
Diffstat (limited to 'crawl-ref/source/ng-input.cc')
-rw-r--r--crawl-ref/source/ng-input.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/ng-input.cc b/crawl-ref/source/ng-input.cc
index 86667aa093..316dd8b165 100644
--- a/crawl-ref/source/ng-input.cc
+++ b/crawl-ref/source/ng-input.cc
@@ -80,7 +80,7 @@ bool is_good_name(const std::string& name, bool blankOK, bool verbose)
static bool _read_player_name(std::string &name)
{
const int name_x = wherex(), name_y = wherey();
- char buf[kNameLen];
+ char buf[kNameLen + 1];
// XXX: Prompt displays garbage otherwise, but don't really know why.
// Other places don't do this. --rob
buf[0] = '\0';