Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Improper comparison with TCL_INDEX_NONE to indicate null-terminated strings

Closed / Fixede56486a257f75d5f413d52b22b49fa8c428f3806Created 1 year agoUpdated 1 year ago
Descriptionmarkdown2025-11-12 06:30:01

String length parameters to several C functions are documented (in both 8.6 and 9.0) as If the length is negative, the encoding-specific length of the string is used.

While 8.6 correctly checked for negative lengths as (srcLen < 0), this has been changed in 9.0 to (srcLen == TCL_INDEX_NONE). Aside from changing the documented semantics, this also has resulted in the functions not handling the case of negative values other than -1.

The checks should be reverted back to checking for negative values as opposed to checking for TCL_INDEX_NONE.

apnadkarniplain2025-11-14 17:31:41
Fixed in [aeba91beb2].
Log in (anonymous is fine) to add a comment.