From 7573c53457486a37d3c2a61e27691d01675bb255 Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Sun, 4 Oct 2020 06:40:56 -0400 Subject: [PATCH] Fix silly bug in titleGetNcmContentMetaTypeName. --- code_templates/nacp_xml_generator.c | 10 ++++++++++ source/title.c | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/code_templates/nacp_xml_generator.c b/code_templates/nacp_xml_generator.c index f758bd4..5153ad8 100644 --- a/code_templates/nacp_xml_generator.c +++ b/code_templates/nacp_xml_generator.c @@ -206,6 +206,16 @@ int main(int argc, char *argv[]) FILE *xml_fd = NULL; char path[FS_MAX_PATH] = {0}; + sprintf(path, "sdmc:/%s.nacp", nca_ctx->content_id_str); + + xml_fd = fopen(path, "wb"); + if (xml_fd) + { + fwrite(nacp_ctx.data, 1, sizeof(_NacpStruct), xml_fd); + fclose(xml_fd); + xml_fd = NULL; + } + sprintf(path, "sdmc:/%s.nacp.xml", nca_ctx->content_id_str); xml_fd = fopen(path, "wb"); diff --git a/source/title.c b/source/title.c index 789a8d5..3a94678 100644 --- a/source/title.c +++ b/source/title.c @@ -866,8 +866,8 @@ const char *titleGetNcmContentTypeName(u8 content_type) const char *titleGetNcmContentMetaTypeName(u8 content_meta_type) { - return ((content_meta_type <= NcmContentMetaType_BootImagePackageSafe || (content_meta_type >= NcmContentMetaType_Application && content_meta_type <= NcmContentMetaType_Delta)) ? \ - g_titleNcmContentMetaTypeNames[content_meta_type] : NULL); + if ((content_meta_type > NcmContentMetaType_BootImagePackageSafe && content_meta_type < NcmContentMetaType_Application) || content_meta_type > NcmContentMetaType_Delta) return NULL; + return (content_meta_type <= NcmContentMetaType_BootImagePackageSafe ? g_titleNcmContentMetaTypeNames[content_meta_type] : g_titleNcmContentMetaTypeNames[content_meta_type - 0x7A]); } NX_INLINE void titleFreeApplicationMetadata(void)