mirror of
				https://github.com/isar/libmdbx.git
				synced 2025-11-04 05:08:57 +08:00 
			
		
		
		
	mdbx-windows: fix mdbx_strdup() usage.
Fix commit e229dbe9dc (12 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43).
Change-Id: Ic63864d736319ccba37518a50590f4e21282a451
			
			
This commit is contained in:
		@@ -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) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user