FILE
*file;
+ int
+ count;
+
WCHAR
*mode_wide,
*path_wide;
count=MultiByteToWideChar(CP_UTF8,0,path,-1,NULL,0);
path_wide=(WCHAR *) AcquireQuantumMemory(count,sizeof(*path_wide));
if (path_wide == (WCHAR *) NULL)
- return(-1);
+ return((FILE *) NULL);
count=MultiByteToWideChar(CP_UTF8,0,path,-1,path_wide,count);
count=MultiByteToWideChar(CP_UTF8,0,mode,-1,NULL,0);
mode_wide=(WCHAR *) AcquireQuantumMemory(count,sizeof(*mode_wide));
if (mode_wide == (WCHAR *) NULL)
{
path_wide=RelinquishMagickMemory(path_wide);
- return(-1);
+ return((FILE *) NULL);
}
count=MultiByteToWideChar(CP_UTF8,0,mode,-1,mode_wide,count);
- file=_wfopen(path_wide,mode_width);
+ file=_wfopen(path_wide,mode_wide);
mode_wide=RelinquishMagickMemory(mode_wide);
path_wide=RelinquishMagickMemory(path_wide);
return(file);
FILE
*file;
+ int
+ count;
+
WCHAR
*type_wide,
*command_wide;
count=MultiByteToWideChar(CP_UTF8,0,command,-1,NULL,0);
command_wide=(WCHAR *) AcquireQuantumMemory(count,sizeof(*command_wide));
if (command_wide == (WCHAR *) NULL)
- return(-1);
+ return((FILE *) NULL);
count=MultiByteToWideChar(CP_UTF8,0,command,-1,command_wide,count);
count=MultiByteToWideChar(CP_UTF8,0,type,-1,NULL,0);
type_wide=(WCHAR *) AcquireQuantumMemory(count,sizeof(*type_wide));
if (type_wide == (WCHAR *) NULL)
{
command_wide=RelinquishMagickMemory(command_wide);
- return(-1);
+ return((FILE *) NULL);
}
count=MultiByteToWideChar(CP_UTF8,0,type,-1,type_wide,count);
- file=_wpopen(path_wide,type_width);
+ file=_wpopen(command_wide,type_wide);
type_wide=RelinquishMagickMemory(type_wide);
- path_wide=RelinquishMagickMemory(path_wide);
+ command_wide=RelinquishMagickMemory(command_wide);
return(file);
#endif
}
#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__)
return(rename(source,destination));
#else
- FILE
- *file;
-
int
+ count,
status;
WCHAR
return(-1);
}
count=MultiByteToWideChar(CP_UTF8,0,destination,-1,destination_wide,count);
- status=_wrename(path_wide,destination_width);
+ status=_wrename(source_wide,destination_wide);
destination_wide=RelinquishMagickMemory(destination_wide);
- path_wide=RelinquishMagickMemory(path_wide);
+ source_wide=RelinquishMagickMemory(source_wide);
return(status);
#endif
}
if (path_wide == (WCHAR *) NULL)
return(-1);
count=MultiByteToWideChar(CP_UTF8,0,path,-1,path_wide,count);
- status=_wstat(path_wide,attributes);
+ status=wstat(path_wide,attributes);
path_wide=RelinquishMagickMemory(path_wide);
return(status);
#endif