summaryrefslogtreecommitdiffhomepage
path: root/tests/custom
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-02-11 17:53:53 +0100
committerJo-Philipp Wich <jo@mein.io>2022-02-11 18:00:45 +0100
commit116a8ce35fd50e586d1c79d6f99237428adfa2ef (patch)
tree083a191c4171711231ef24c2b5c2316f32917af9 /tests/custom
parenta317c17f5ddfc3f749d349de01eeea5cad3eb162 (diff)
vallist: fix storing/retrieving short strings with 8bit byte values
Due to using signed byte values when writing/reading short strings to/from pointer addresses, 8 bit characters where incorrectly clamped to `-1` (`255`). Fix this issue by treating the input string as `uint8_t` array. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/custom')
-rw-r--r--tests/custom/04_bugs/31_vallist_8bit_shortstrings11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/custom/04_bugs/31_vallist_8bit_shortstrings b/tests/custom/04_bugs/31_vallist_8bit_shortstrings
new file mode 100644
index 0000000..98ccf0b
--- /dev/null
+++ b/tests/custom/04_bugs/31_vallist_8bit_shortstrings
@@ -0,0 +1,11 @@
+Due to using signed byte values when writing/reading short strings
+to/from pointer addresses, 8 bit characters where incorrectly clamped
+to `-1` (`255`).
+
+-- Testcase --
+{{ ord("รถ", 1)[0] != -1 }}
+-- End --
+
+-- Expect stdout --
+true
+-- End --