Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Change to avoid range error
Browse files Browse the repository at this point in the history
  • Loading branch information
schveiguy committed Sep 8, 2015
1 parent 3f9c4a6 commit 51241ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/internal/string.d
Expand Up @@ -79,7 +79,7 @@ auto signedToTempString(long value, char[] buf, uint radix) @safe
{
// about to do a slice without a bounds check
assert(r.ptr > buf.ptr);
r = (() @trusted => r.ptr[-1..r.length])();
r = (() @trusted => (r.ptr-1)[0..r.length+1])();
r[0] = '-';
}
return r;
Expand Down

0 comments on commit 51241ae

Please sign in to comment.