diff options
author | Wez Furlong <wez@php.net> | 2004-03-07 21:36:55 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-03-07 21:36:55 +0000 |
commit | 0dd22801027ebc3c1e19a451780c9f5348972765 (patch) | |
tree | 1e08f357c6af42d041dfb51089a415931d0a3fad /main | |
parent | 4fffb840057363e48a4b58f287c63005aa8b00fd (diff) | |
download | php-git-0dd22801027ebc3c1e19a451780c9f5348972765.tar.gz |
Less magic please
Diffstat (limited to 'main')
-rwxr-xr-x | main/streams/streams.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index 79f56f0cc4..29049a4bde 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1881,7 +1881,10 @@ PHPAPI int _php_stream_scandir(char *dirname, php_stream_dirent **namelist[], in vector = (php_stream_dirent **) erealloc(vector, vector_size * sizeof(php_stream_dirent *)); } - vector[nfiles++] = (php_stream_dirent*)estrndup((const char *)&sdp, sizeof(php_stream_dirent) + ((strlen(sdp.d_name) + 1) * sizeof(char))); + vector[nfiles] = emalloc(sizeof(php_stream_dirent)); + memcpy(vector[nfiles], &sdp, sizeof(sdp)); + + nfiles++; } php_stream_closedir(stream); |