What steps will reproduce the problem?
---------------------------------------
The following code outputs "13" rather than "D"
Code:
unsigned long test = 13;
String thisString = String(test, HEX);
Serial.println(thisString);
See - http://arduino.cc/forum/index.php/topic,66634.0.html
What is the expected output? What do you see instead?
------------------------------------------------------
Expected: D
See: 13
What version of the Arduino software are you using? On what operating
system? Which Arduino board are you using?
--------------------------------------------
IDE 22 - windows 7 - 328
Please provide any additional information below.
-------------------------------------------------
File: Wstring.cpp
String::String( const unsigned long value, const int base )
{
char buf[33];
ultoa(value, buf, 10);
getBuffer( _length = strlen(buf) );
if ( _buffer != NULL )
strcpy( _buffer, buf );
}
should be changed in
String::String( const unsigned long value, const int base )
{
char buf[33];
ultoa(value, buf, base);
getBuffer( _length = strlen(buf) );
if ( _buffer != NULL )
strcpy( _buffer, buf );
}
Original issue reported on code.google.com by rob.till...@gmail.com on 5 Aug 2011 at 8:05
Original issue reported on code.google.com by
rob.till...@gmail.com
on 5 Aug 2011 at 8:05