aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/WString.cpp
diff options
context:
space:
mode:
authorSandeep Mistry <s.mistry@arduino.cc>2016-07-12 17:29:13 -0400
committerSandeep Mistry <s.mistry@arduino.cc>2016-07-12 17:29:13 -0400
commit5dd628a2c29a0e077405970b778bf41264b030dd (patch)
tree058dc5d2802a2e7a394d674d7305da632dc8001d /cores/arduino/WString.cpp
parent2717fbe05bf6341dd79acebdfccc9ffd5e2b1223 (diff)
Make String::move of an invalidated String result in an invalidated String
Diffstat (limited to 'cores/arduino/WString.cpp')
-rw-r--r--cores/arduino/WString.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp
index cd3e0e8..9975303 100644
--- a/cores/arduino/WString.cpp
+++ b/cores/arduino/WString.cpp
@@ -193,7 +193,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length)
void String::move(String &rhs)
{
if (buffer) {
- if (capacity >= rhs.len) {
+ if (rhs && capacity >= rhs.len) {
strcpy(buffer, rhs.buffer);
len = rhs.len;
rhs.len = 0;