From ac5d548e90eb3314e718dea91fd27a355bc73ade Mon Sep 17 00:00:00 2001 From: emoose Date: Mon, 24 Feb 2020 19:31:13 +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 b574af1df..71fa6046b 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc @@ -727,7 +727,7 @@ class StringFormatData : public FormatData { void skip(int32_t count) { while (count-- > 0) { - if (!*input_) { + if (!get()) { break; } } @@ -760,11 +760,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; } } @@ -794,11 +794,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; } }