diff options
author | Steven Moreland <smoreland@google.com> | 2017-02-28 19:38:58 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-02-28 19:38:58 +0000 |
commit | 20eb9dd1c220ceb5763dc5322c69921a2671cb37 (patch) | |
tree | 97ae917203d7df632dec86b70583d2eea45d78d5 /base/HidlSupport.cpp | |
parent | 40318d963db442ac5c2b125ec815180da65f2c2c (diff) | |
parent | b41903097556d7f6dfa517c817cc544ab300772d (diff) | |
download | libhidl-20eb9dd1c220ceb5763dc5322c69921a2671cb37.tar.gz |
Merge "Make operator= and constructor behavior consistent." am: ecfdacd86c am: 7e7e4a3860
am: b419030975
Change-Id: I7944ded56032b4e65aabb407349a54fe1450fdc1
Diffstat (limited to 'base/HidlSupport.cpp')
-rw-r--r-- | base/HidlSupport.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp index 0612050..7add055 100644 --- a/base/HidlSupport.cpp +++ b/base/HidlSupport.cpp @@ -240,6 +240,11 @@ hidl_string &hidl_string::operator=(const hidl_string &other) { hidl_string &hidl_string::operator=(const char *s) { clear(); + + if (s == nullptr) { + return *this; + } + copyFrom(s, strlen(s)); return *this; } |