diff options
Diffstat (limited to 'src/utils/mkdir.cpp')
-rw-r--r-- | src/utils/mkdir.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/mkdir.cpp b/src/utils/mkdir.cpp index d61fae919..d4005f4ab 100644 --- a/src/utils/mkdir.cpp +++ b/src/utils/mkdir.cpp @@ -40,6 +40,9 @@ #if defined WIN32 int mkdir_r(const char *const pathname) { + if (!pathname) + return -1; + char tmp[PATH_MAX]; char tmp2[PATH_MAX]; char *p; @@ -111,6 +114,9 @@ int mkdir_r(const char *const pathname) /// Create a directory, making leading components first if necessary int mkdir_r(const char *const pathname) { + if (!pathname) + return -1; + const size_t len = static_cast<size_t>(strlen(pathname)); char *tmp = new char[len + 2]; char *p; |