diff options
| author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-08-05 00:36:59 +0100 |
|---|---|---|
| committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-08-05 00:36:59 +0100 |
| commit | 3570ea9189183705f639e41f7828055bee60ee43 (patch) | |
| tree | 530a8f2ff95d95d76cfe44d2121cb3806db0289a | |
| parent | f4e2db5b434516c03c0b29f73a07c3041c36cdcf (diff) | |
| download | mariadb-git-3570ea9189183705f639e41f7828055bee60ee43.tar.gz | |
remove warning on Windows
Replace do-it-yourself version of strdup() with real strdup().
| -rw-r--r-- | extra/mariabackup/backup_copy.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 8b474c37e4b..907e5e94257 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -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--); |
