Change the type of `len` to `size_t` and get rid of the cast to `int` in `len += (int)STRLEN(hexbuf);`