Commit 3570ea91 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

remove warning on Windows

Replace do-it-yourself version of strdup() with real strdup().
parent f4e2db5b
...@@ -644,13 +644,10 @@ int ...@@ -644,13 +644,10 @@ int
mkdirp(const char *pathname, int Flags, myf MyFlags) mkdirp(const char *pathname, int Flags, myf MyFlags)
{ {
char *parent, *p; char *parent, *p;
int len = strlen(pathname) + 1;
/* make a parent directory path */ /* make a parent directory path */
if (!(parent= (char *)malloc(len))) if (!(parent= strdup(pathname)))
return(-1); return(-1);
strncpy(parent, pathname, len);
parent[len-1]= 0;
for (p = parent + strlen(parent); for (p = parent + strlen(parent);
!is_path_separator(*p) && p != parent; p--); !is_path_separator(*p) && p != parent; p--);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment