From 213f7b9a6aed3f8fe984040da7c983b0040237ea Mon Sep 17 00:00:00 2001 From: emoose Date: Tue, 24 Dec 2019 06:12:49 +0000 Subject: [PATCH] [Kernel] *FormatData: make peek() match get() endian, fix skip() not advancing pointer --- src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc index aa1bbf245..b5a4c9241 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc @@ -728,7 +728,7 @@ class StringFormatData : public FormatData { void skip(int32_t count) { while (count-- > 0) { - if (!*input_) { + if (!get()) { break; } } @@ -761,11 +761,11 @@ class WideStringFormatData : public FormatData { return xe::byte_swap(result); } - uint16_t peek(int32_t offset) { return input_[offset]; } + uint16_t peek(int32_t offset) { return xe::byte_swap(input_[offset]); } void skip(int32_t count) { while (count-- > 0) { - if (!*input_) { + if (!get()) { break; } } @@ -795,11 +795,11 @@ class WideCountFormatData : public FormatData { return xe::byte_swap(result); } - uint16_t peek(int32_t offset) { return input_[offset]; } + uint16_t peek(int32_t offset) { return xe::byte_swap(input_[offset]); } void skip(int32_t count) { while (count-- > 0) { - if (!*input_) { + if (!get()) { break; } }