com php-src: avoid repeated strlen usage: TSRM/tsrm_win32 .c
| From: | Anatol Belski | Date: | Sun, 14 Sep 2014 15:00:34 +0000 |
| Subject: | com php-src: avoid repeated strlen usage: TSRM/tsrm_win32 .c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81612@lists.php.net to get a copy of this message | ||
Commit: 90972355b3d23e8c099e119cb7b2e0fbb463beab
Author: Anatol Belski <ab@php.net> Sun, 14 Sep 2014 17:00:34 +0200
Parents: ad9dc751509a53a7930e8716db6b51b489866328
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=90972355b3d23e8c099e119cb7b2e0fbb463beab
Log:
avoid repeated strlen usage
Changed paths:
M TSRM/tsrm_win32.c
Diff:
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 0b8228a..7a7ab5d 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;