summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-09-14 17:00:34 +0200
committerAnatol Belski <ab@php.net>2014-09-14 17:00:34 +0200
commit90972355b3d23e8c099e119cb7b2e0fbb463beab (patch)
tree55fabf832431884951fb5079e1898f199c36e665 /TSRM
parentad9dc751509a53a7930e8716db6b51b489866328 (diff)
downloadphp-git-90972355b3d23e8c099e119cb7b2e0fbb463beab.tar.gz
avoid repeated strlen usage
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/tsrm_win32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 0b8228aafb..7a7ab5dfcb 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -212,7 +212,8 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
DWORD type;
return GetBinaryType(pathname, &type) ? 0 : -1;
} else {
- if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
+ size_t pathname_len = strlen(pathname) + 1;
+ if(!IS_ABSOLUTE_PATH(pathname, pathname_len)) {
real_path = (char *)malloc(MAX_PATH);
if(tsrm_realpath(pathname, real_path TSRMLS_CC) == NULL) {
goto Finished;