summaryrefslogtreecommitdiff
path: root/TSRM/tsrm_win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'TSRM/tsrm_win32.c')
-rw-r--r--TSRM/tsrm_win32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index a116aaf457..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;
@@ -457,7 +458,7 @@ TSRM_API FILE *popen(const char *command, const char *type)
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC)
{
FILE *stream = NULL;
- int fno, type_len = strlen(type), read, mode;
+ int fno, type_len, read, mode;
STARTUPINFO startup;
PROCESS_INFORMATION process;
SECURITY_ATTRIBUTES security;