]> www.infradead.org Git - users/borneoa/openocd-next.git/commit
binarybuffer: str_to_buf(): align prefix to TCL syntax
authorAntonio Borneo <borneo.antonio@gmail.com>
Sun, 25 Aug 2024 13:38:07 +0000 (15:38 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 7 Sep 2024 11:37:15 +0000 (11:37 +0000)
commit4680d6ebdf142f9dd1acdc439d4e146ed36a290b
tree08d8583e04bf4f56fdf0f70df179254e521d93b8
parente09bb72da50c9a9878565af23ee8d5465c11526d
binarybuffer: str_to_buf(): align prefix to TCL syntax

Integer values are interpreted by TCL as decimal, binary, octal
or hexadecimal if prepended with '0d', '0b', '0o' or '0x'
respectively.
The case of '0' prefix has been interpreted as octal till TCL 8.6
but is interpreted as part of a decimal number by JimTCL and from
TCL 9.

Align str_to_buf() to latest TCL syntax by:
- addding support for '0d', '0b' and '0o' prefix;
- dropping support for '0' prefix.

Change-Id: I708ef72146d75b7bf429df329a0269cf48700a44
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8465
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
src/helper/binarybuffer.c