The type of `len` can be changed to `size_t` here inside this block. Then you can remove the `(int)STRLEN` cast.