summaryrefslogtreecommitdiff
path: root/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-11-16 23:08:18 +0000
committerRyan Mitchell <rtmitchell@google.com>2020-12-08 16:58:12 +0000
commit80094e39f90801c44cd80ab0f98df505828ea1f3 (patch)
treee70d5241691a509ce9cf774dc39ce85932fdd1d2 /cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp
parentec7e7f5622e3444a3003db20ddfd8f5745971fa7 (diff)
Revert^2 "libandroidfw hardening for IncFs"
55ef6167a2c235bd88c7216238b2001b46795b79 Change-Id: I02d4890d181655dfd0a14c188468db512559d27b Merged-In: I02d4890d181655dfd0a14c188468db512559d27b
Diffstat (limited to 'cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp')
-rw-r--r--cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp b/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp
index a93202a64d31..3037a791328e 100644
--- a/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp
+++ b/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp
@@ -100,10 +100,9 @@ void PrettyPrintVisitor::visit(const IdmapData& data) {
stream_ << TAB << base::StringPrintf("0x%08x -> ", target_entry.target_id)
<< utils::DataTypeToString(target_entry.value.data_type);
- size_t unused;
if (target_entry.value.data_type == Res_value::TYPE_STRING) {
- auto str = string_pool.stringAt(target_entry.value.data_value - string_pool_offset, &unused);
- stream_ << " \"" << StringPiece16(str) << "\"";
+ auto str = string_pool.stringAt(target_entry.value.data_value - string_pool_offset);
+ stream_ << " \"" << str.value_or(StringPiece16(u"")) << "\"";
} else {
stream_ << " " << base::StringPrintf("0x%08x", target_entry.value.data_value);
}