mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-12 19:03:10 +03:00
fixed reading the not initialized data
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
parent
316cac613c
commit
97025ab61a
@ -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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user