summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-18 14:49:16 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-18 14:49:16 +0300
commita388dc3736be1d26dffc8badd109620d4ede63ee (patch)
treefd920ecd08b7489d5ae63bb4befcdb18b960a4a5
parent10a3a7480fda94ab755676c203dca15b3779b6ed (diff)
downloadmv-a388dc3736be1d26dffc8badd109620d4ede63ee.tar.gz
mv-a388dc3736be1d26dffc8badd109620d4ede63ee.tar.bz2
mv-a388dc3736be1d26dffc8badd109620d4ede63ee.tar.xz
mv-a388dc3736be1d26dffc8badd109620d4ede63ee.zip
Fix compilation warning.
-rw-r--r--src/utils/mkdir.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/utils/mkdir.cpp b/src/utils/mkdir.cpp
index 18d526d47..f0cc65f53 100644
--- a/src/utils/mkdir.cpp
+++ b/src/utils/mkdir.cpp
@@ -41,7 +41,7 @@
int mkdir_r(const char *pathname)
{
size_t len = static_cast<int>(strlen(pathname));
- char tmp[len+2];
+ char *tmp = new char[len + 2];
char *p;
strcpy(tmp, pathname);
@@ -79,7 +79,10 @@ int mkdir_r(const char *pathname)
continue;
}
else
+ {
+ delete tmp;
return -1;
+ }
}
#if defined WIN32
@@ -94,6 +97,7 @@ int mkdir_r(const char *pathname)
if (!(strlen(tmp) == 2 &&
!strcmp(tmp + 1, ":")))
#endif
+ delete tmp;
return -1;
}
@@ -103,6 +107,7 @@ int mkdir_r(const char *pathname)
*p = '/';
}
}
+ delete tmp;
return 0;
}