From 50bfce889e07711450adace72d5eed785d71ee2e Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sun, 4 Jul 2010 16:36:52 +0000 Subject: Modifying String from new/delete to malloc()/free(). Also #include'ing WString.h from WProgram.h. --- cores/arduino/WString.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cores/arduino/WString.cpp') diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index 667a304..91d4f15 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -113,7 +113,7 @@ const String & String::operator=( const String &rhs ) if ( rhs._length > _length ) { - delete [] _buffer; + free(_buffer); getBuffer( rhs._length ); } _length = rhs._length; @@ -139,7 +139,7 @@ const String & String::operator+=( const String &other ) char *temp = _buffer; getBuffer( _length ); strcpy( _buffer, temp ); - delete [] temp; + free(temp); } strcat( _buffer, other._buffer ); return *this; -- cgit v1.2.3-18-g5258