| commit | 69b9b36c114680c87251ab0f140fd5d6b61e1fa9 | [log] [tgz] | 
|---|---|---|
| author | Wei Wang <wvw@google.com> | Mon Nov 14 20:05:21 2016 -0800 | 
| committer | Wei Wang <wvw@google.com> | Mon Nov 14 20:20:48 2016 -0800 | 
| tree | 5b8a5c1832d2d6a767298aaa54ac7baf4f261164 | |
| parent | 557359863c0d1fcda9a85e3b7fb275cb12a3eb70 [diff] | 
init: fix BuildTriggersString for empty string behavior is undefined if pop_back() on empty std::string Test: grep init log Bug: 32712851 Bug: 32838381 Change-Id: I5bfac2fb275036abd0158b78df14019d2e82716d
diff --git a/init/action.cpp b/init/action.cpp index a12f225..e9b2a0d 100644 --- a/init/action.cpp +++ b/init/action.cpp
@@ -249,7 +249,9 @@ result += event_trigger_; result += ' '; } - result.pop_back(); + if (!result.empty()) { + result.pop_back(); + } return result; }