summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-04-26 07:29:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-04-26 07:29:02 (GMT)
commita4c35fb82f99d990ca1ef877cb9917c7f55151ff (patch)
treecdd02327448cf2c0393cbf3cea4fd48bb17e52c4 /generic/tclUtil.c
parent81a213ed4ce77b15fbc6d5d97cc1235b689ad482 (diff)
parente12b1646c6f675cf09d5f1a72d4ecdffa5da7396 (diff)
downloadtcl-a4c35fb82f99d990ca1ef877cb9917c7f55151ff.zip
tcl-a4c35fb82f99d990ca1ef877cb9917c7f55151ff.tar.gz
tcl-a4c35fb82f99d990ca1ef877cb9917c7f55151ff.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 32721f6..66d1009 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -802,9 +802,11 @@ TclCopyAndCollapse(
char c = *src;
if (c == '\\') {
+ char buf[4] = "";
int numRead;
- int backslashCount = TclParseBackslash(src, count, &numRead, dst);
+ int backslashCount = TclParseBackslash(src, count, &numRead, buf);
+ memcpy(dst, buf, backslashCount);
dst += backslashCount;
newCount += backslashCount;
src += numRead;
@@ -3229,7 +3231,7 @@ Tcl_PrintDouble(
* Handle NaN.
*/
- if (TclIsNaN(value)) {
+ if (isnan(value)) {
TclFormatNaN(value, dst);
return;
}
@@ -3238,7 +3240,7 @@ Tcl_PrintDouble(
* Handle infinities.
*/
- if (TclIsInfinite(value)) {
+ if (isinf(value)) {
/*
* Remember to copy the terminating NUL too.
*/
@@ -3699,11 +3701,11 @@ Tcl_GetIntForIndex(
{
Tcl_WideInt wide;
- if (GetWideForIndex(interp, objPtr, (size_t)(endValue + 1) - 1, &wide) == TCL_ERROR) {
+ if (GetWideForIndex(interp, objPtr, endValue, &wide) == TCL_ERROR) {
return TCL_ERROR;
}
if (indexPtr != NULL) {
- if ((wide < 0) && (endValue > TCL_INDEX_END)) {
+ if ((wide < 0) && (endValue >= 0)) {
*indexPtr = -1;
} else if (wide > INT_MAX) {
*indexPtr = INT_MAX;
@@ -3784,7 +3786,7 @@ GetEndOffsetFromObj(
if ((TclMaxListLength(bytes, -1, NULL) > 1)
/* If it's possible, do the full list parse. */
- && (TCL_OK == Tcl_ListObjLength(NULL, objPtr, &length))
+ && (TCL_OK == TclListObjLength(NULL, objPtr, &length))
&& (length > 1)) {
goto parseError;
}