From a8fd33c7efd6f25fb6127467ad6547bd8e9c995a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 24 Jul 2014 14:36:23 +0000 Subject: minor code reorganization git-svn-id: http://svn.miranda-ng.org/main/trunk@9931 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/path.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3