Skip to content

Commit

Permalink
[jak2] better handling of invalid formats (#3171)
Browse files Browse the repository at this point in the history
see #3143
  • Loading branch information
ManDude committed Nov 6, 2023
1 parent 8179d0a commit 299a25b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions game/kernel/jak2/kprint.cpp
Expand Up @@ -229,7 +229,6 @@ s32 format_impl_jak2(uint64_t* args) {
case 'w':
case 'y':
case 'z':
case 1: // jak 2 japanese encoding
while (arg_start < format_ptr + 1) {
*output_ptr = *arg_start;
arg_start++;
Expand Down Expand Up @@ -517,12 +516,15 @@ s32 format_impl_jak2(uint64_t* args) {
default:
MsgErr("format: unknown code 0x%02x\n", format_ptr[1]);
MsgErr("input was %s\n", format_cstring);
ASSERT(false);
// ASSERT(false);
goto copy_char_hack;
break;
}
format_ptr++;
} else {
// got normal char, just copy it
// got normal char, just copy it
copy_char_hack: // we goto here if we get a bad code for ~, which sort of backtracks and falls
// back to regular character copying
*output_ptr = *format_ptr;
output_ptr++;
}
Expand Down

0 comments on commit 299a25b

Please sign in to comment.