mdbx-windows: fix mdbx_strdup() usage.

Fix commit e229dbe9dca1ff117a714007cc3811c01ba98b8b (12 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43).

Change-Id: Ic63864d736319ccba37518a50590f4e21282a451
This commit is contained in:
Leonid Yuriev 2018-10-14 17:28:00 +03:00
parent ae83982811
commit 582adda628
3 changed files with 4 additions and 4 deletions

View File

@ -430,7 +430,7 @@ static __inline size_t mdbx_syspagesize(void) {
} }
#ifndef mdbx_strdup #ifndef mdbx_strdup
char *mdbx_strdup(const char *str); LIBMDBX_API char *mdbx_strdup(const char *str);
#endif #endif
static __inline int mdbx_get_errno(void) { static __inline int mdbx_get_errno(void) {

View File

@ -164,7 +164,7 @@ static walk_dbi_t *pagemap_lookup_dbi(const char *dbi_name, bool silent) {
return NULL; return NULL;
} }
dbi->name = strdup(dbi_name); dbi->name = mdbx_strdup(dbi_name);
if (verbose > 1 && !silent) { if (verbose > 1 && !silent) {
print(" - found '%s' area\n", dbi_name); print(" - found '%s' area\n", dbi_name);
fflush(NULL); fflush(NULL);

View File

@ -111,7 +111,7 @@ static void readhdr(void) {
*ptr = '\0'; *ptr = '\0';
if (subname) if (subname)
mdbx_free(subname); mdbx_free(subname);
subname = strdup((char *)dbuf.iov_base + STRLENOF("database=")); subname = mdbx_strdup((char *)dbuf.iov_base + STRLENOF("database="));
} else if (!strncmp(dbuf.iov_base, "type=", STRLENOF("type="))) { } else if (!strncmp(dbuf.iov_base, "type=", STRLENOF("type="))) {
if (strncmp((char *)dbuf.iov_base + STRLENOF("type="), "btree", if (strncmp((char *)dbuf.iov_base + STRLENOF("type="), "btree",
STRLENOF("btree"))) { STRLENOF("btree"))) {
@ -349,7 +349,7 @@ int main(int argc, char *argv[]) {
envflags |= MDBX_NOSUBDIR; envflags |= MDBX_NOSUBDIR;
break; break;
case 's': case 's':
subname = strdup(optarg); subname = mdbx_strdup(optarg);
break; break;
case 'N': case 'N':
putflags = MDBX_NOOVERWRITE | MDBX_NODUPDATA; putflags = MDBX_NOOVERWRITE | MDBX_NODUPDATA;