diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-18 14:49:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-18 14:49:16 +0300 |
commit | a388dc3736be1d26dffc8badd109620d4ede63ee (patch) | |
tree | fd920ecd08b7489d5ae63bb4befcdb18b960a4a5 /src | |
parent | 10a3a7480fda94ab755676c203dca15b3779b6ed (diff) | |
download | plus-a388dc3736be1d26dffc8badd109620d4ede63ee.tar.gz plus-a388dc3736be1d26dffc8badd109620d4ede63ee.tar.bz2 plus-a388dc3736be1d26dffc8badd109620d4ede63ee.tar.xz plus-a388dc3736be1d26dffc8badd109620d4ede63ee.zip |
Fix compilation warning.
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/mkdir.cpp | 7 |
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; } |