mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-26 12:12:02 +00:00
title: trim display version string before duplicating it.
This commit is contained in:
parent
78f780a981
commit
a16f62fe6d
1 changed files with 14 additions and 3 deletions
|
@ -2433,7 +2433,7 @@ static char *titleGetPatchVersionString(TitleInfo *title_info)
|
||||||
u8 storage_id = 0, hfs_partition_type = 0;
|
u8 storage_id = 0, hfs_partition_type = 0;
|
||||||
NcaContext *nca_ctx = NULL;
|
NcaContext *nca_ctx = NULL;
|
||||||
NacpContext nacp_ctx = {0};
|
NacpContext nacp_ctx = {0};
|
||||||
char *str = NULL;
|
char display_version[0x11] = {0}, *str = NULL;
|
||||||
|
|
||||||
if (!title_info || title_info->meta_key.type != NcmContentMetaType_Patch || !(nacp_content = titleGetContentInfoByTypeAndIdOffset(title_info, NcmContentType_Control, 0)))
|
if (!title_info || title_info->meta_key.type != NcmContentMetaType_Patch || !(nacp_content = titleGetContentInfoByTypeAndIdOffset(title_info, NcmContentType_Control, 0)))
|
||||||
{
|
{
|
||||||
|
@ -2467,8 +2467,19 @@ static char *titleGetPatchVersionString(TitleInfo *title_info)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get version string. */
|
/* Get trimmed version string. */
|
||||||
str = strndup(nacp_ctx.data->display_version, sizeof(nacp_ctx.data->display_version));
|
snprintf(display_version, sizeof(display_version), "%s", nacp_ctx.data->display_version);
|
||||||
|
utilsTrimString(display_version);
|
||||||
|
|
||||||
|
/* Check version string length. */
|
||||||
|
if (!*display_version)
|
||||||
|
{
|
||||||
|
LOG_MSG("Display version string from %016lX is empty!", title_info->meta_key.id);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Duplicate version string. */
|
||||||
|
str = strdup(display_version);
|
||||||
if (!str) LOG_MSG("Failed to duplicate version string from %016lX!", title_info->meta_key.id);
|
if (!str) LOG_MSG("Failed to duplicate version string from %016lX!", title_info->meta_key.id);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
Loading…
Reference in a new issue