summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-09-27 19:34:59 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-09-27 19:34:59 (GMT)
commitf275a7d75401fe7aca194722e9d20c7e58ec9169 (patch)
treee66edc704088546fce04b066ca256caaf70eb339
parentc91b19f7bac0008bb4b74e40096663a5035c7b19 (diff)
downloadtcl-f275a7d75401fe7aca194722e9d20c7e58ec9169.zip
tcl-f275a7d75401fe7aca194722e9d20c7e58ec9169.tar.gz
tcl-f275a7d75401fe7aca194722e9d20c7e58ec9169.tar.bz2
Corrected sanity test in zero-element case
-rw-r--r--generic/tclCmdIL.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 73144f8..af3c3bb 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.154 2008/09/27 14:16:42 dkf Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.155 2008/09/27 19:34:59 dkf Exp $
*/
#include "tclInt.h"
@@ -2479,7 +2479,8 @@ Tcl_LrepeatObjCmd(
*/
totalElems = objc * elementCount;
- if (totalElems/objc != elementCount || totalElems/elementCount != objc) {
+ if (totalElems != 0 && (totalElems/objc != elementCount
+ || totalElems/elementCount != objc)) {
Tcl_AppendResult(interp, "too many elements in result list", NULL);
return TCL_ERROR;
}