This is an automated email from Gerrit. "Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8398
-- gerrit commit c4f9d68f08b566ae5d21ed402a8e6da4095511c0 Author: Antonio Borneo <borneo.anto...@gmail.com> Date: Sun Jul 14 15:27:30 2024 +0200 binarybuffer: str_to_buf(): support optional separator '_' While handling long sequence of digits, mainly binary, it's more comfortable and readable using a separator in the same way ',' is often used for the thousands. Add the support for '_' as generic separator. It is ignored, so it can be used in any position in the number. Change-Id: I46abbc92c412487e0690a7a816fcce762a492f63 Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com> diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index 930cf12f90..507f89dbb7 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -272,7 +272,9 @@ int str_to_buf(const char *str, void *_buf, unsigned int buf_bitsize) unsigned int tmp; const char c = *str; - if ((c >= '0') && (c <= '9')) { + if (c == '_') { + continue; + } else if ((c >= '0') && (c <= '9')) { tmp = c - '0'; } else if ((c >= 'a') && (c <= 'f')) { tmp = c - 'a' + 10; --