File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,17 +73,15 @@ size_t IPAddress::printTo(Print& p) const
7373 return n;
7474}
7575
76- char * IPAddress::toCharArray ()
76+ String IPAddress::toString ()
7777{
78- static char szRet[20 ];
7978 String str = String (_address.bytes [0 ]);
8079 str += " ." ;
8180 str += String (_address.bytes [1 ]);
8281 str += " ." ;
8382 str += String (_address.bytes [2 ]);
8483 str += " ." ;
8584 str += String (_address.bytes [3 ]);
86- str.toCharArray (szRet, 20 );
87- return szRet;
85+ return str;
8886}
8987
Original file line number Diff line number Diff line change 2121#define IPAddress_h
2222
2323#include < stdint.h>
24+ #include < WString.h>
2425#include < Printable.h>
2526
2627// A class to make it easier to handle and pass around IP addresses
@@ -60,7 +61,7 @@ class IPAddress : public Printable {
6061 IPAddress& operator =(uint32_t address);
6162
6263 virtual size_t printTo (Print& p) const ;
63- char * toCharArray ();
64+ String toString ();
6465
6566 friend class EthernetClass ;
6667 friend class UDP ;
You can’t perform that action at this time.
0 commit comments