aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb/db_lmdb.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-12-29 00:11:46 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-12-29 00:11:46 +0000
commit3b56036bb393358f287d2ba2bc95af29ff0ea490 (patch)
tree21c62d64a8c67f1333ae7a4c66765cf55f1e9204 /src/blockchain_db/lmdb/db_lmdb.cpp
parentblockchain: always stop the ioservice before returning (diff)
parentTweak 45800a25e9374e63caaabba05c89585c86acd668 (diff)
downloadmonero-3b56036bb393358f287d2ba2bc95af29ff0ea490.tar.xz
Merge pull request #1 from LMDB/crash-fix
Tweak 45800a25e9374e63caaabba05c89585c86acd668
Diffstat (limited to 'src/blockchain_db/lmdb/db_lmdb.cpp')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 85eaf4569..0fd18bc18 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -131,15 +131,15 @@ template<>
struct MDB_val_copy<const char*>: public MDB_val
{
MDB_val_copy(const char *s):
- len(strlen(s)),
- data(new char[len+1])
+ size(strlen(s)+1), // include the NUL, makes it easier for compares
+ data(new char[size])
{
- memcpy(data.get(), s, len+1);
- mv_size = len + 1; // include the NUL, makes it easier for compares
+ mv_size = size;
mv_data = data.get();
+ memcpy(mv_data, s, size);
}
private:
- size_t len;
+ size_t size;
std::unique_ptr<char[]> data;
};