com php-src: fix datatype mismatch: win32/readdir.c
| From: | Anatol Belski | Date: | Tue, 28 Oct 2014 16:24:54 +0000 |
| Subject: | com php-src: fix datatype mismatch: win32/readdir.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82753@lists.php.net to get a copy of this message | ||
Commit: 77ab77fd02b24aac32594c4f5f6ad21a2e961ed7
Author: Anatol Belski <ab@php.net> Mon, 27 Oct 2014 18:57:51 +0100
Parents: e048426402aa81c3b45473aa71c9bf8b9eee1a6f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=77ab77fd02b24aac32594c4f5f6ad21a2e961ed7
Log:
fix datatype mismatch
Changed paths:
M win32/readdir.c
Diff:
diff --git a/win32/readdir.c b/win32/readdir.c
index 0edd576..4e59921 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';