From aa3747d95b0e4ced59b97d5f902290364e8eca70 Mon Sep 17 00:00:00 2001 From: haranp Date: Sat, 13 Dec 2008 13:09:55 +0000 Subject: 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 --- crawl-ref/source/command.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crawl-ref/source/command.cc') 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]); -- cgit v1.2.3-54-g00ecf