diff --git a/win32/readdir.c b/win32/readdir.c index 0edd5764d49..4e5992167c9 100644 --- a/win32/readdir.c +++ b/win32/readdir.c @@ -37,7 +37,7 @@ DIR *opendir(const char *dir) return NULL; } strcpy(filespec, resolved_path_buff); - index = strlen(filespec) - 1; + index = (int)strlen(filespec) - 1; if (index >= 0 && (filespec[index] == '/' || (filespec[index] == '\\' && (index == 0 || !IsDBCSLeadByte(filespec[index-1]))))) filespec[index] = '\0'; @@ -83,7 +83,7 @@ struct dirent *readdir(DIR *dp) strlcpy(dp->dent.d_name, dp->fileinfo.cFileName, _MAX_FNAME+1); dp->dent.d_ino = 1; - dp->dent.d_reclen = strlen(dp->dent.d_name); + dp->dent.d_reclen = (unsigned short)strlen(dp->dent.d_name); dp->dent.d_off = dp->offset; return &(dp->dent); @@ -107,7 +107,7 @@ int readdir_r(DIR *dp, struct dirent *entry, struct dirent **result) strlcpy(dp->dent.d_name, dp->fileinfo.cFileName, _MAX_FNAME+1); dp->dent.d_ino = 1; - dp->dent.d_reclen = strlen(dp->dent.d_name); + dp->dent.d_reclen = (unsigned short)strlen(dp->dent.d_name); dp->dent.d_off = dp->offset; memcpy(entry, &dp->dent, sizeof(*entry)); @@ -152,7 +152,7 @@ int rewinddir(DIR *dp) } strcpy(filespec, dp->dir); - index = strlen(filespec) - 1; + index = (int)strlen(filespec) - 1; if (index >= 0 && (filespec[index] == '/' || (filespec[index] == '\\' && (index == 0 || !IsDBCSLeadByte(filespec[index-1]))))) filespec[index] = '\0';