diff options
author | hobbs <hobbs> | 2003-02-09 07:48:22 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2003-02-09 07:48:22 (GMT) |
commit | 9d1525754196bc3da08fd80f693f7cd24c50ab10 (patch) | |
tree | c6933d15bed38ac3ee37519fe2b9700aeee30333 /generic/tkCanvPoly.c | |
parent | d3f940de47f1e49a943a67d56fa64aaa543bd4bc (diff) | |
download | tk-9d1525754196bc3da08fd80f693f7cd24c50ab10.zip tk-9d1525754196bc3da08fd80f693f7cd24c50ab10.tar.gz tk-9d1525754196bc3da08fd80f693f7cd24c50ab10.tar.bz2 |
* generic/tkCanvArc.c (CreateArc): Rework canvas create item
* generic/tkCanvBmap.c (CreateBitmap): type coords handling to be
* generic/tkCanvImg.c (CreateImage): consistent across types
* generic/tkCanvPoly.c (CreatePolygon): and not pass empty coords
* generic/tkCanvLine.c (CreateLine): to item creation procs.
* generic/tkCanvText.c (CreateText):
* generic/tkCanvWind.c (CreateWinItem):
* generic/tkCanvas.c (CanvasWidgetCmd CANV_CREATE):
* generic/tkRectOval.c (CreateRectOval):
* tests/canvRect.test:
* tests/canvText.test:
* tests/canvas.test:
Diffstat (limited to 'generic/tkCanvPoly.c')
-rw-r--r-- | generic/tkCanvPoly.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index b3f5374..5058b9f 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvPoly.c,v 1.9 2002/08/05 04:30:38 dgp Exp $ + * RCS: @(#) $Id: tkCanvPoly.c,v 1.10 2003/02/09 07:48:22 hobbs Exp $ */ #include <stdio.h> @@ -266,6 +266,10 @@ CreatePolygon(interp, canvas, itemPtr, objc, objv) PolygonItem *polyPtr = (PolygonItem *) itemPtr; int i; + if (objc == 0) { + panic("canvas did not pass any coords\n"); + } + /* * Carry out initialization that is needed in order to clean * up after errors during the the remainder of this procedure. @@ -368,9 +372,10 @@ PolygonCoords(interp, canvas, itemPtr, objc, objv) } } if (objc & 1) { - Tcl_AppendResult(interp, - "odd number of coordinates specified for polygon", - (char *) NULL); + char buf[64 + TCL_INTEGER_SPACE]; + sprintf(buf, "wrong # coordinates: expected an even number, got %d", + objc); + Tcl_SetResult(interp, buf, TCL_VOLATILE); return TCL_ERROR; } else { numPoints = objc/2; |