fix bounds checking failure message

casting the `uint` to an `int` can result in printing high values as
negative intege
This commit is contained in:
Daniel Micay 2013-10-14 22:43:03 -04:00
parent a7e8957c59
commit 420b4260b4
3 changed files with 1 additions and 41 deletions

View file

@ -25,7 +25,7 @@ pub fn fail_(expr: *c_char, file: *c_char, line: size_t) -> ! {
pub fn fail_bounds_check(file: *c_char, line: size_t,
index: size_t, len: size_t) {
let msg = format!("index out of bounds: the len is {} but the index is {}",
len as int, index as int);
len as uint, index as uint);
do msg.with_c_str |buf| {
fail_(buf, file, line);
}