diff options
author | dgp <dgp@users.sourceforge.net> | 2022-03-11 19:30:42 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2022-03-11 19:30:42 (GMT) |
commit | bb7ee39d95f814300c0965014259a6d7049d8507 (patch) | |
tree | 226225f11f055253dbe9b13245e03547d5504df8 | |
parent | ebbf66a53f956763aba0ebed810c14e34d523166 (diff) | |
download | tcl-bb7ee39d95f814300c0965014259a6d7049d8507.zip tcl-bb7ee39d95f814300c0965014259a6d7049d8507.tar.gz tcl-bb7ee39d95f814300c0965014259a6d7049d8507.tar.bz2 |
Revise the loop logic to be more correct, more clear, and more consisten
with other branches.
-rw-r--r-- | generic/tclBinary.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c index c0569a5..8b9d510 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -566,12 +566,12 @@ UpdateStringOfByteArray( */ size = length; - for (i = 0; i < length && size < INT_MAX; i++) { + for (i = 0; i < length && size <= INT_MAX; i++) { if ((src[i] == 0) || (src[i] > 127)) { size++; } } - if (i < length) { + if (size > INT_MAX) { Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } |