mirror of
https://github.com/Atmosphere-NX/hac2l.git
synced 2025-08-07 07:59:28 +02:00
hac2l: fix keys not working without newline at eof
This commit is contained in:
parent
402231eb3d
commit
3048cde118
@ -470,7 +470,7 @@ namespace ams::hactool {
|
||||
}
|
||||
|
||||
/* Allocate buffer for the file. */
|
||||
auto buf = std::make_unique<char[]>(file_size);
|
||||
auto buf = std::make_unique<char[]>(file_size + 1);
|
||||
if (buf == nullptr) {
|
||||
fprintf(stderr, "[Warning]: failed to allocate memory for key file (%s)\n", path);
|
||||
return;
|
||||
@ -482,6 +482,9 @@ namespace ams::hactool {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Null-terminate the file contents. */
|
||||
buf[file_size] = '\x00';
|
||||
|
||||
ProcessKeyValueFile(path, buf.get(), file_size, f);
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ namespace ams::hactool {
|
||||
}
|
||||
|
||||
if (m_has_base_pfs && !m_base_pfs_ctx.is_exefs) {
|
||||
m_has_base_xci = false;
|
||||
m_has_base_pfs = false;
|
||||
GetBaseFromAppFs(m_base_pfs_ctx.app_ctx, "basepfs");
|
||||
m_has_base_pfs = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user