Skip to content

Commit 5ca3dc4

Browse files
committed
fix issue of not appending '\0' at end when parent path is root.
1 parent 54e300b commit 5ca3dc4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/dfs/dfs_v2/src/dfs_file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ static int _get_parent_path(const char *fullpath, char *path)
7676
}
7777
else if (len == 0) /* parent path is root path. */
7878
{
79-
rt_memcpy(path, "/", 1);
79+
path[0] = '/';
80+
path[1] = '\0';
8081
len = 1;
8182
}
8283
}

0 commit comments

Comments
 (0)