tests: Pass correct length for buffer

This allocated 64 bytes and then told snprinf it was 128. That's a
no-no even if we never need that much.
This commit is contained in:
Fabian Boehm 2024-04-03 20:08:27 +02:00
parent 66c6e89f98
commit 1f2e0617d1

View File

@ -123,7 +123,7 @@ fn test_format() {
let mut buff1 = [0_u8; 64];
let mut buff2 = [0_u8; 64];
format_llong_safe(&mut buff1, q);
unsafe { libc::snprintf(buff2.as_mut_ptr().cast(), 128, "%ld\0".as_ptr().cast(), q) };
unsafe { libc::snprintf(buff2.as_mut_ptr().cast(), 64, "%ld\0".as_ptr().cast(), q) };
assert_eq!(cstr2wcstring(&buff1), cstr2wcstring(&buff2));
}