[tcldom-libxml2.c:2065]: (style) Array index 'idx' is used before limits check.
Source code is
for (idx = 0; buf[idx] != ':' && idx < len; idx++) ;
Suggest sanity check array index before use.
The code is correct since Tcl_GetStringFromObject returns a pointer to a \0-terminated string that is not counted when determining the length.
The code is correct
Maybe I've been slightly less than clear. The issue isn't the correctness of the code.
Suggest re-read the message produced.
The code is bad style and so IMHO and the static analysis tool's opinion needs rework.
OK, I see the point. It will be fixed soon.
Log in to post a comment.
The code is correct since Tcl_GetStringFromObject returns a pointer to a \0-terminated string that is not counted when determining the length.
Maybe I've been slightly less than clear. The issue
isn't the correctness of the code.
Suggest re-read the message produced.
The code is bad style and so IMHO and the static analysis tool's opinion needs rework.
OK, I see the point. It will be fixed soon.