From 0865c8c9b0ab4618b75adb571dc0e7c25cee9a49 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Tue, 8 May 2018 18:33:47 +0100 Subject: [PATCH] fix warning by terminating string instead --- nx/source/runtime/devices/fs_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx/source/runtime/devices/fs_dev.c b/nx/source/runtime/devices/fs_dev.c index 13c37ed8..d10f249a 100644 --- a/nx/source/runtime/devices/fs_dev.c +++ b/nx/source/runtime/devices/fs_dev.c @@ -199,7 +199,7 @@ fsdev_fixpath(struct _reent *r, strncpy(__fixedpath, path, PATH_MAX); else { - strcpy(__fixedpath, __cwd); + strncpy(__fixedpath, __cwd, PATH_MAX); __fixedpath[PATH_MAX] = 0; strncat(__fixedpath, path, PATH_MAX - strlen(__cwd)); } @@ -1039,7 +1039,7 @@ fsdev_chdir(struct _reent *r, if(R_SUCCEEDED(rc)) { fsDirClose(&fd); - strcpy(__cwd, __fixedpath); + strncpy(__cwd, __fixedpath, PATH_MAX);__cwd[PATH_MAX] = 0; fsdev_fsdevice_cwd = device->id; return 0; }