mirror of
https://github.com/google/leveldb.git
synced 2025-01-27 06:30:07 +08:00
strdup -> _strdup (standard conformant)
This commit is contained in:
parent
068d5ee1a3
commit
6df8a451b0
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@
|
||||
# Build directory.
|
||||
build/
|
||||
out/
|
||||
/.vs
|
||||
|
6
db/c.cc
6
db/c.cc
@ -149,11 +149,11 @@ static bool SaveError(char** errptr, const Status& s) {
|
||||
if (s.ok()) {
|
||||
return false;
|
||||
} else if (*errptr == nullptr) {
|
||||
*errptr = strdup(s.ToString().c_str());
|
||||
*errptr = _strdup(s.ToString().c_str());
|
||||
} else {
|
||||
// TODO(sanjay): Merge with existing error?
|
||||
std::free(*errptr);
|
||||
*errptr = strdup(s.ToString().c_str());
|
||||
*errptr = _strdup(s.ToString().c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -239,7 +239,7 @@ char* leveldb_property_value(leveldb_t* db, const char* propname) {
|
||||
std::string tmp;
|
||||
if (db->rep->GetProperty(Slice(propname), &tmp)) {
|
||||
// We use strdup() since we expect human readable output.
|
||||
return strdup(tmp.c_str());
|
||||
return _strdup(tmp.c_str());
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user