HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData)
{
- char* p;
+ LPSTR p;
int index;
int length;
struct stat fileStat;
p = strrchr(lpFileName, '\\');
index = (p - lpFileName);
- length = (p - lpFileName);
+ length = (p - lpFileName) + 1;
pFileSearch->lpPath = (LPSTR) malloc(length + 1);
if (!pFileSearch->lpPath)
HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData)
{
- char* utfFileName = NULL;
+ LPSTR utfFileName = NULL;
HANDLE h;
LPWIN32_FIND_DATAA fd = (LPWIN32_FIND_DATAA)calloc(1, sizeof(WIN32_FIND_DATAA));