fs: be consistent about no stack temps in fsFs

This commit is contained in:
Michael Scire 2020-03-07 14:14:06 -08:00 committed by fincs
parent c3b0b63471
commit afbf2c6f71

View File

@ -629,9 +629,6 @@ Result fsFsQueryEntry(FsFileSystem* fs, void *out, size_t out_size, const void *
if (hosversionBefore(4,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
char send_path[FS_MAX_PATH] = {0};
strncpy(send_path, path, sizeof(send_path)-1);
return _fsObjectDispatchIn(&fs->s, 15, query_id,
.buffer_attrs = {
SfBufferAttr_HipcPointer | SfBufferAttr_In,
@ -639,9 +636,9 @@ Result fsFsQueryEntry(FsFileSystem* fs, void *out, size_t out_size, const void *
SfBufferAttr_HipcMapAlias | SfBufferAttr_Out | SfBufferAttr_HipcMapTransferAllowsNonSecure,
},
.buffers = {
{ send_path, sizeof(send_path) },
{ in, in_size },
{ out, out_size },
{ path, FS_MAX_PATH },
{ in, in_size },
{ out, out_size },
},
);
}
@ -655,7 +652,8 @@ Result fsFsIsValidSignedSystemPartitionOnSdCard(FsFileSystem* fs, bool *out) {
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
u8 tmp=0;
Result rc = fsFsQueryEntry(fs, &tmp, sizeof(tmp), NULL, 0, "/", FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard);
char send_path[FS_MAX_PATH] = "/";
Result rc = fsFsQueryEntry(fs, &tmp, sizeof(tmp), NULL, 0, send_path, FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard);
if (R_SUCCEEDED(rc) && out) *out = tmp & 1;
return rc;
}