Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #90 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Array bounds exception in Atoi

Reported by: keinfarbton Assigned to: kris
Priority: critical Milestone: 1.0
Component: Tango Version: 0.95 beta 1
Keywords: Cc:

Description

I only want to convert "0", but the char![] has a 'x' immediatly after the '0'. Atoi tries to find a radix prefix in trim. In this case trim returns 2 for the eaten which is used in a slicing operation.

char[] str = "0x";
Atoi.parse( str[0..1], 16 ); // Exception if build with -g -debug

Change History

08/19/06 13:27:40 changed by kris

  • status changed from new to closed.
  • version set to 1.0.
  • resolution set to fixed.
  • milestone set to 1.0.

two bugs fixed: one in trim() where specific circumstances might cause an invalid result, and one in parse() where 'ate' was not being set correctly