summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclClock.c7
-rw-r--r--generic/tclObj.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index e348d58..2f54977 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclClock.c,v 1.31 2004/09/08 15:38:33 kennykb Exp $
+ * RCS: @(#) $Id: tclClock.c,v 1.32 2004/09/11 18:57:56 kennykb Exp $
*/
#include "tclInt.h"
@@ -224,6 +224,7 @@ TclClockMktimeObjCmd( ClientData clientData,
int i;
struct tm toConvert; /* Time to be converted */
time_t convertedTime; /* Time converted from mktime */
+ int localErrno;
/* Convert parameters */
@@ -265,12 +266,14 @@ TclClockMktimeObjCmd( ClientData clientData,
TzsetIfNecessary();
Tcl_MutexLock( &clockMutex );
+ errno = 0;
convertedTime = mktime( &toConvert );
+ localErrno = errno;
Tcl_MutexUnlock( &clockMutex );
/* Return the converted time, or an error if conversion fails */
- if ( convertedTime == -1 ) {
+ if ( localErrno != 0 ) {
Tcl_SetObjResult
( interp,
Tcl_NewStringObj( "time value too large/small to represent",
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 7c9fb47..d681a26 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclObj.c,v 1.65 2004/09/10 22:43:52 dgp Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.66 2004/09/11 18:57:56 kennykb Exp $
*/
#include "tclInt.h"
@@ -1961,7 +1961,7 @@ Tcl_GetIntFromObj(interp, objPtr, intPtr)
}
if (((long)((int)l)) == l) {
- *intPtr = (int)objPtr->internalRep.longValue;
+ *intPtr = (int)l;
return TCL_OK;
}
#ifndef TCL_WIDE_INT_IS_LONG