Skip to content
Tcl Source Code View Ticket
Login

View Ticket

string repeat returns confusing error message

Closed / Invalid2582327fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2009-02-09 18:31:48
$ tclsh8.6
% string repeat "abc" 1234567890
max size for a Tcl value (2147483647 bytes) exceeded
% expr 1234567890 >= 2147483647
0
% expr 1234567890 < 2147483647
1
% 

string repeat seems to report that the argument exceeds a value which it is, in fact, smaller than.

Perhaps the error message means something else?
dgpplain2009-02-10 04:22:41
allow_comments - 1


% string length "abc"
3
% expr 3*1234567890
3703703670
% expr 3*1234567890 < 2147483647
0
andreas_kupriesplain2009-02-10 04:32:28
What Don apparently wishes to express is that it is the _result_ of the 'string repeat' which is overflowing, and that this is what the error message is for.
Log in (anonymous is fine) to add a comment.