summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2019-04-03 14:06:35 -0700
committer android-build-merger <android-build-merger@google.com> 2019-04-03 14:06:35 -0700
commit02beda366f5eea67c00c1f0c5fa885f17ecfe296 (patch)
tree76718a11d5f9fe224cdc413c2320cf6dd9b4de1a
parent809f0349e8e4dc0d2eb6faa2982890a96d072820 (diff)
parent59e43277ac8e86a438eb2fe9278c078e2df68466 (diff)
Merge "Fix debug output." am: d2013b4478 am: cad30d34e0
am: 59e43277ac Change-Id: I8c0d17dacc57bbb676d970ce78f73bf0e5c5fd98
-rw-r--r--libs/binder/Debug.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/binder/Debug.cpp b/libs/binder/Debug.cpp
index f38bbb2f32..a1c2a8be08 100644
--- a/libs/binder/Debug.cpp
+++ b/libs/binder/Debug.cpp
@@ -221,7 +221,11 @@ void printHexData(int32_t indent, const void *buf, size_t length,
for (word = 0; word < bytesPerLine; ) {
- const size_t startIndex = word+(alignment-(alignment?1:0));
+ size_t align_offset = alignment-(alignment?1:0);
+ if (remain > 0 && (size_t)remain <= align_offset) {
+ align_offset = remain - 1;
+ }
+ const size_t startIndex = word+align_offset;
for (index = 0; index < alignment || (alignment == 0 && index < bytesPerLine); index++) {