Skip to content

Commit

Permalink
remove warning on Windows
Browse files Browse the repository at this point in the history
Replace do-it-yourself version of strdup() with real strdup().
  • Loading branch information
vaintroub committed Aug 4, 2018
1 parent f4e2db5 commit 3570ea9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,10 @@ int
mkdirp(const char *pathname, int Flags, myf MyFlags)
{
char *parent, *p;
int len = strlen(pathname) + 1;

/* make a parent directory path */
if (!(parent= (char *)malloc(len)))
if (!(parent= strdup(pathname)))
return(-1);
strncpy(parent, pathname, len);
parent[len-1]= 0;

for (p = parent + strlen(parent);
!is_path_separator(*p) && p != parent; p--);
Expand Down

0 comments on commit 3570ea9

Please sign in to comment.