diff options
-rw-r--r-- | src/mir_core/path.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mir_core/path.cpp b/src/mir_core/path.cpp index e3d6093bb2..4eb54b594b 100644 --- a/src/mir_core/path.cpp +++ b/src/mir_core/path.cpp @@ -31,10 +31,9 @@ static TCHAR szMirandaPathW[MAX_PATH]; MIR_CORE_DLL(int) PathIsAbsolute(const char *path)
{
- if (strlen(path) <= 2)
- return 0;
- if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
- return 1;
+ if (path && strlen(path) > 2)
+ if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
+ return 1;
return 0;
}
@@ -118,10 +117,9 @@ MIR_CORE_DLL(int) CreateDirectoryTree(const char *szDir) MIR_CORE_DLL(int) PathIsAbsoluteW(const TCHAR *path)
{
- if (lstrlen(path) <= 2)
- return 0;
- if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
- return 1;
+ if (path && _tcslen(path) > 2)
+ if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
+ return 1;
return 0;
}
|