diff options
author | dkf <dkf@noemail.net> | 2003-10-08 14:21:18 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2003-10-08 14:21:18 (GMT) |
commit | 520bf171fd7e1a0f0b3305c85923212c66248119 (patch) | |
tree | c7a20e4018242cdfdaa708c55f922f1d0cc48b5a /generic/tclUtf.c | |
parent | 34b38749625de9ca8d9426b8a3267cac8149c9e2 (diff) | |
download | tcl-520bf171fd7e1a0f0b3305c85923212c66248119.zip tcl-520bf171fd7e1a0f0b3305c85923212c66248119.tar.gz tcl-520bf171fd7e1a0f0b3305c85923212c66248119.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: 257a93c349af03b8547b9f19208bc34c7e5ceebd
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 cc8c3c7..b7a6277 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.30.2.1 2003/03/06 23:24:17 dgp Exp $ + * RCS: @(#) $Id: tclUtf.c,v 1.30.2.2 2003/10/08 14:21:20 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 { |