summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/sqldbm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/sqldbm.cc')
-rw-r--r--crawl-ref/source/sqldbm.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/sqldbm.cc b/crawl-ref/source/sqldbm.cc
index fee11a9d46..7a6956f08c 100644
--- a/crawl-ref/source/sqldbm.cc
+++ b/crawl-ref/source/sqldbm.cc
@@ -183,7 +183,8 @@ sql_datum::sql_datum(const std::string &s) : dptr(NULL), dsize(s.length()),
{
if ((dptr = new char [dsize]))
{
- strcpy(dptr, s.c_str());
+ if (dsize)
+ memcpy(dptr, s.c_str(), dsize);
need_free = true;
}
}