fixed reading the not initialized data

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Ilia Maslakov 2012-03-12 21:46:23 +04:00 committed by Slava Zanko
parent 316cac613c
commit 97025ab61a

View File

@ -811,6 +811,9 @@ vfs_path_add_element (const vfs_path_t * vpath, const vfs_path_element_t * path_
const vfs_path_element_t * const vfs_path_element_t *
vfs_path_get_by_index (const vfs_path_t * vpath, int element_index) vfs_path_get_by_index (const vfs_path_t * vpath, int element_index)
{ {
if (vpath == NULL)
return NULL;
if (element_index < 0) if (element_index < 0)
element_index += vfs_path_elements_count (vpath); element_index += vfs_path_elements_count (vpath);