mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Fix interpolation/STRFMT overflow issues
Widths and fractional widths greater than 255 would overflow a uint8_t and wrap around to smaller values. Total formatted lengths greater than the avilable buffer size would overflow it and potentially corrupt memory. Fixes #830 Closes #831
This commit is contained in:
15
test/asm/format-truncation.asm
Normal file
15
test/asm/format-truncation.asm
Normal file
@@ -0,0 +1,15 @@
|
||||
num equ 42
|
||||
fix equ 123.456
|
||||
str equs "hello"
|
||||
|
||||
println "{#0260x:num}"
|
||||
println "{#-260x:num}"
|
||||
println "{0280.260f:fix}"
|
||||
println "{260s:str}"
|
||||
println "{-260s:str}"
|
||||
|
||||
println "<{#0260x:num}>"
|
||||
println "<{#-260x:num}>"
|
||||
println "<{0280.260f:fix}>"
|
||||
println "<{260s:str}>"
|
||||
println "<{-260s:str}>"
|
||||
Reference in New Issue
Block a user