summaryrefslogtreecommitdiffstats
path: root/generic/tclInterp.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclInterp.c')
-rw-r--r--generic/tclInterp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index aaa2291..79b4634 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -4831,14 +4831,14 @@ ChildTimeLimitCmd(
if (TclGetWideIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
return TCL_ERROR;
}
- if (tmp < 0 || tmp > LONG_MAX) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "milliseconds must be between 0 and %ld", LONG_MAX));
+ if (tmp < 0) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "milliseconds must be non-negative", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
"BADVALUE", NULL);
return TCL_ERROR;
}
- limitMoment.usec = ((long)tmp)*1000;
+ limitMoment.usec = tmp*1000;
break;
case OPT_SEC:
secObj = objv[i+1];
@@ -4849,14 +4849,14 @@ ChildTimeLimitCmd(
if (TclGetWideIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
return TCL_ERROR;
}
- if (tmp < 0 || tmp > LONG_MAX) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "seconds must be between 0 and %ld", LONG_MAX));
+ if (tmp < 0) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "seconds must be non-negative", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
"BADVALUE", NULL);
return TCL_ERROR;
}
- limitMoment.sec = (long)tmp;
+ limitMoment.sec = (long long)tmp;
break;
}
}