From 5dd628a2c29a0e077405970b778bf41264b030dd Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Tue, 12 Jul 2016 17:29:13 -0400 Subject: Make String::move of an invalidated String result in an invalidated String --- cores/arduino/WString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cores') 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; -- cgit v1.2.3-18-g5258