should be sizeof()-1 for strncpy in fsOpenFileSystemWithId

This commit is contained in:
Rajko Stojadinovic 2018-07-28 04:09:13 +02:00
parent 18a841c850
commit ef704044ae

View File

@ -432,7 +432,7 @@ Result fsOpenFileSystem(FsFileSystem* out, u64 titleId, FsFileSystemType fsType)
Result fsOpenFileSystemWithId(FsFileSystem* out, u64 titleId, FsFileSystemType fsType, const char* contentPath) { Result fsOpenFileSystemWithId(FsFileSystem* out, u64 titleId, FsFileSystemType fsType, const char* contentPath) {
char sendStr[FS_MAX_PATH]; char sendStr[FS_MAX_PATH];
strncpy(sendStr, contentPath, sizeof(sendStr)); strncpy(sendStr, contentPath, sizeof(sendStr)-1);
sendStr[sizeof(sendStr)-1] = 0; sendStr[sizeof(sendStr)-1] = 0;
IpcCommand c; IpcCommand c;