Skip to content

Commit 97182b9

Browse files
committed
Internal change.
PiperOrigin-RevId: 708625855
1 parent f7ad032 commit 97182b9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/seccheck/server.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ void unpackSyscall(absl::string_view buf) {
7272
if (!evt.ParseFromArray(buf.data(), buf.size())) {
7373
err(1, "ParseFromString(): %.*s", static_cast<int>(buf.size()), buf.data());
7474
}
75-
log("%s %s %s\n", evt.has_exit() ? "X" : "E",
76-
evt.GetDescriptor()->name().c_str(), shortfmt(evt).c_str());
75+
absl::string_view name = evt.GetDescriptor()->name();
76+
log("%s %.*s %s\n", evt.has_exit() ? "X" : "E", static_cast<int>(name.size()),
77+
name.data(), shortfmt(evt).c_str());
7778
}
7879

7980
template <class T>
@@ -82,7 +83,9 @@ void unpack(absl::string_view buf) {
8283
if (!evt.ParseFromArray(buf.data(), buf.size())) {
8384
err(1, "ParseFromString(): %.*s", static_cast<int>(buf.size()), buf.data());
8485
}
85-
log("%s => %s\n", evt.GetDescriptor()->name().c_str(), shortfmt(evt).c_str());
86+
absl::string_view name = evt.GetDescriptor()->name();
87+
log("%.*s => %s\n", static_cast<int>(name.size()), name.data(),
88+
shortfmt(evt).c_str());
8689
}
8790

8891
// List of dispatchers indexed based on MessageType enum values.

0 commit comments

Comments
 (0)