mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
commit
3b56036bb3
@ -131,15 +131,15 @@ template<>
|
|||||||
struct MDB_val_copy<const char*>: public MDB_val
|
struct MDB_val_copy<const char*>: public MDB_val
|
||||||
{
|
{
|
||||||
MDB_val_copy(const char *s):
|
MDB_val_copy(const char *s):
|
||||||
len(strlen(s)),
|
size(strlen(s)+1), // include the NUL, makes it easier for compares
|
||||||
data(new char[len+1])
|
data(new char[size])
|
||||||
{
|
{
|
||||||
memcpy(data.get(), s, len+1);
|
mv_size = size;
|
||||||
mv_size = len + 1; // include the NUL, makes it easier for compares
|
|
||||||
mv_data = data.get();
|
mv_data = data.get();
|
||||||
|
memcpy(mv_data, s, size);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
size_t len;
|
size_t size;
|
||||||
std::unique_ptr<char[]> data;
|
std::unique_ptr<char[]> data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user