]> granicus.if.org Git - php/commitdiff
avoid repeated strlen usage
authorAnatol Belski <ab@php.net>
Sun, 14 Sep 2014 15:00:34 +0000 (17:00 +0200)
committerAnatol Belski <ab@php.net>
Sun, 14 Sep 2014 15:00:34 +0000 (17:00 +0200)
TSRM/tsrm_win32.c

index 0b8228aafb84fda9fec62b61a7ceb0578c555148..7a7ab5dfcb38be29e4d35b38f2ad74284e7e398e 100644 (file)
@@ -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;