csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Sun Aug 27, 2006 12:04 am Post subject: Possible mistake in mango.convert.Atoi |
|
|
At line 165 of mango.convert.Atoi is the 'parse' function.
Code: |
static long parse (T[] digits, uint radix=0, uint* ate=null)
{
uint rdx;
bool sign;
int eaten = trim (digits, sign, rdx);
if (radix)
rdx = radix;
ulong result = convert (digits[eaten..length], rdx, ate);
if (ate)
ate += eaten;
return cast(long) (sign ? -result : result);
}
|
If I'm not mistaken lines 177-178 should instead read:
Code: |
if (ate)
*ate += eaten;
|
Otherwise it is just advancing the pointer into random memory, rather than actually returning the consumption as intended. _________________ Chris Nicholson-Sauls |
|