summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-03-07 21:36:55 +0000
committerWez Furlong <wez@php.net>2004-03-07 21:36:55 +0000
commit0dd22801027ebc3c1e19a451780c9f5348972765 (patch)
tree1e08f357c6af42d041dfb51089a415931d0a3fad /main
parent4fffb840057363e48a4b58f287c63005aa8b00fd (diff)
downloadphp-git-0dd22801027ebc3c1e19a451780c9f5348972765.tar.gz
Less magic please
Diffstat (limited to 'main')
-rwxr-xr-xmain/streams/streams.c5
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);