summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/command.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-13 13:09:55 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-13 13:09:55 +0000
commitaa3747d95b0e4ced59b97d5f902290364e8eca70 (patch)
tree7889c008076561736a2fb7966b5219ba4c647aae /crawl-ref/source/command.cc
parentf41f4cb56e95d2e36fa21b9504282d9e34eddc75 (diff)
downloadcrawl-ref-aa3747d95b0e4ced59b97d5f902290364e8eca70.tar.gz
crawl-ref-aa3747d95b0e4ced59b97d5f902290364e8eca70.zip
Fix a security hole introduced in r7048 (bad parsing of search regexps.)
Add -Wno-parentheses to remove all the warnings about && vs. ||. (I agree with g++ here, actually...) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7821 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r--crawl-ref/source/command.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index db48b3ce26..c65bcb02ae 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1387,7 +1387,7 @@ static bool _do_description(std::string key, std::string footer = "")
if (thing_created != NON_ITEM)
{
char name[80];
- snprintf(name, 80, key.c_str());
+ strncpy(name, key.c_str(), sizeof(name));
if (get_item_by_name(&mitm[thing_created], name, OBJ_WEAPONS))
{
append_weapon_stats(desc, mitm[thing_created]);