]> granicus.if.org Git - php/commitdiff
Avoid multiple wcslen calls
authorAnatol Belski <ab@php.net>
Sun, 18 Feb 2018 14:26:33 +0000 (15:26 +0100)
committerAnatol Belski <ab@php.net>
Sun, 18 Feb 2018 14:26:33 +0000 (15:26 +0100)
win32/ioutil.h

index 5e25333936dd131866d5dfeecabffba0635d4cd7..8676fd5ac49dade0d5409ff39ebe5919fa2e9a61 100644 (file)
@@ -155,7 +155,8 @@ typedef enum {
        (len) > 1 && !PHP_WIN32_IOUTIL_IS_SLASHW(pathw[(len)-2]) && L'.' != pathw[(len)-2] && L'.' == pathw[(len)-1]))
 
 #define PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, ret, dealloc) do { \
-               if (!PHP_WIN32_IOUTIL_PATH_IS_OK_W(pathw, wcslen(pathw))) { \
+               size_t _len = wcslen(pathw); \
+               if (!PHP_WIN32_IOUTIL_PATH_IS_OK_W(pathw, _len)) { \
                        if (dealloc) { \
                                free((void *)pathw); \
                        } \