diff --git a/fs/hostfs/hostfs.c b/fs/hostfs/hostfs.c index f250f3d9892ac..f7c4a70886645 100644 --- a/fs/hostfs/hostfs.c +++ b/fs/hostfs/hostfs.c @@ -228,7 +228,7 @@ static void hostfs_mkpath(FAR struct hostfs_mountpt_s *fs, if (depth >= 0) { - strncat(path, &relpath[first], pathlen - strlen(path) - 1); + strlcat(path, &relpath[first], pathlen - strlen(path)); } } diff --git a/fs/rpmsgfs/rpmsgfs.c b/fs/rpmsgfs/rpmsgfs.c index c8b8d048b28e9..d46a2c0e84b19 100644 --- a/fs/rpmsgfs/rpmsgfs.c +++ b/fs/rpmsgfs/rpmsgfs.c @@ -247,7 +247,7 @@ static void rpmsgfs_mkpath(FAR struct rpmsgfs_mountpt_s *fs, if (depth >= 0) { - strncat(path, &relpath[first], pathlen - strlen(path) - 1); + strlcat(path, &relpath[first], pathlen - strlen(path)); } while (fs->timeout > 0)