diff options
author | dkf <dkf@noemail.net> | 2003-10-08 14:24:39 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2003-10-08 14:24:39 (GMT) |
commit | 277dbd36567847ef4ac92aff79e2caa389ef4375 (patch) | |
tree | 1a14dc708ecdaf3d05c05e8ee7e0b36d4778eb67 /generic/tclUtf.c | |
parent | 0114ecaecfdb59bc74537790b9b8bd0819c5a0c9 (diff) | |
download | tcl-277dbd36567847ef4ac92aff79e2caa389ef4375.zip tcl-277dbd36567847ef4ac92aff79e2caa389ef4375.tar.gz tcl-277dbd36567847ef4ac92aff79e2caa389ef4375.tar.bz2 |
Made Tcl_NumUtfChars do the right thing with \u0000 when guessing the length
because of a negative 'length' parameter. [Bug 769812]
FossilOrigin-Name: 6b243da1f01e6a318f8f0d85a35dccef11e5d718
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r-- | generic/tclUtf.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 2e464ed..f0acdd2 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUtf.c,v 1.31 2003/03/06 23:27:14 dgp Exp $ + * RCS: @(#) $Id: tclUtf.c,v 1.32 2003/10/08 14:24:41 dkf Exp $ */ #include "tclInt.h" @@ -501,11 +501,8 @@ Tcl_NumUtfChars(str, len) i = 0; if (len < 0) { - while (1) { + while (*str != '\0') { str += TclUtfToUniChar(str, chPtr); - if (ch == '\0') { - break; - } i++; } } else { |