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

Ticket #509 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Using negative ints with field width in formatting causes "output buffer too small" errors

Reported by: JarrettBillingsley Assigned to: kris
Priority: normal Milestone: 1.0
Component: Tango Version:
Keywords: Cc:

Description

Stdout.formatln("{:x8}", -1);

This gives "tango.core.Exception.IllegalArgumentException: Integer.format : output buffer too small". It's because -1, even though it's interpreted as an int, when sign-extended to a ulong in Integer.format, becomes 0xffffffffffffffff, which is too big to fit into 8 characters. I would expect this to print "ffffffff" instead.

Change History

06/05/07 23:40:27 changed by JarrettBillingsley

  • priority changed from major to normal.

06/06/07 01:12:28 changed by kris

  • owner changed from sean to kris.
  • status changed from new to assigned.
  • version deleted.
  • component changed from Core Functionality to Tango.
  • milestone set to 1.0.

what a drag :}

07/02/07 18:40:46 changed by kris

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed in [2395]

Thanks!