summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_dirsort.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-04-08 16:38:03 -0700
committerJeremy Allison <jra@samba.org>2013-04-11 09:49:41 -0700
commit53d980bb0e70e40a07092c07d5fbd59fc8957f49 (patch)
treee3131cdfccf1df6e3cfeb4e5479594d8ad5203b1 /source3/modules/vfs_dirsort.c
parentb30697f6388600d1557a96ff3ff3a3548ee99d69 (diff)
downloadsamba-53d980bb0e70e40a07092c07d5fbd59fc8957f49.tar.gz
samba-53d980bb0e70e40a07092c07d5fbd59fc8957f49.tar.bz2
samba-53d980bb0e70e40a07092c07d5fbd59fc8957f49.zip
Use an index i rather than re-using a state variable.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/modules/vfs_dirsort.c')
-rw-r--r--source3/modules/vfs_dirsort.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c
index 6fe7c18414..1c24bc95c8 100644
--- a/source3/modules/vfs_dirsort.c
+++ b/source3/modules/vfs_dirsort.c
@@ -44,7 +44,7 @@ static bool open_and_sort_dir (vfs_handle_struct *handle)
{
struct dirent *dp;
struct stat dir_stat;
- long current_pos;
+ unsigned int i;
struct dirsort_privates *data = NULL;
SMB_VFS_HANDLE_GET_DATA(handle, data, struct dirsort_privates,
@@ -77,15 +77,13 @@ static bool open_and_sort_dir (vfs_handle_struct *handle)
if (!data->directory_list) {
return false;
}
- current_pos = data->pos;
- data->pos = 0;
+ i = 0;
while ((dp = SMB_VFS_NEXT_READDIR(handle, data->source_directory,
NULL)) != NULL) {
- data->directory_list[data->pos++] = *dp;
+ data->directory_list[i++] = *dp;
}
/* Sort the directory entries by name */
- data->pos = current_pos;
TYPESAFE_QSORT(data->directory_list, data->number_of_entries, compare_dirent);
return true;
}