Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npdmtool: don't error with missing debug flags, error with multiple set #50

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT([switch-tools],[1.13.0],[https://github.com/switchbrew/switch-tools/issues])
AC_INIT([switch-tools],[1.13.1],[https://github.com/switchbrew/switch-tools/issues])
AC_CONFIG_SRCDIR([src/build_pfs0.c])

AM_INIT_AUTOMAKE([subdir-objects])
Expand Down
14 changes: 5 additions & 9 deletions src/npdmtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,15 +830,11 @@ int CreateNpdm(const char *json, void **dst, u32 *dst_size) {
int allow_debug = 0;
int force_debug = 0;
int force_debug_prod = 0;
if (!cJSON_GetBoolean(value, "allow_debug", &allow_debug)) {
status = 0;
goto NPDM_BUILD_END;
}
if (!cJSON_GetBoolean(value, "force_debug", &force_debug)) {
status = 0;
goto NPDM_BUILD_END;
}
if (!cJSON_GetBoolean(value, "force_debug_prod", &force_debug_prod)) {
cJSON_GetBoolean(value, "allow_debug", &allow_debug);
cJSON_GetBoolean(value, "force_debug", &force_debug);
cJSON_GetBoolean(value, "force_debug_prod", &force_debug_prod);
if ( allow_debug + force_debug + force_debug_prod > 1 ) {
fprintf(stderr, "Only one of allow_debug, force_debug, or force_debug_prod can be set!\n");
status = 0;
goto NPDM_BUILD_END;
}
Expand Down