diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-12-20 14:10:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-12-20 14:10:05 (GMT) |
commit | 48cff4f47c0343d658ad32b1763b8461e9c71114 (patch) | |
tree | 35ef85626b6fc85b944b6a0cbd0331424976917b /generic/tclTest.c | |
parent | e06c316d168cdb8736fb9893c251cea8bab9d94a (diff) | |
download | tcl-48cff4f47c0343d658ad32b1763b8461e9c71114.zip tcl-48cff4f47c0343d658ad32b1763b8461e9c71114.tar.gz tcl-48cff4f47c0343d658ad32b1763b8461e9c71114.tar.bz2 |
formatting
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r-- | generic/tclTest.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index 1c9e605..7b97a65 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -6286,7 +6286,7 @@ TestGetIndexFromObjStructObjCmd( "a", "b", "c", "d", "ee", "ff", NULL, NULL }; int target, flags = 0; - signed char idx[8]; + signed char idx[8]; if (objc != 3 && objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, "argument targetvalue ?flags?"); @@ -6300,15 +6300,15 @@ TestGetIndexFromObjStructObjCmd( } memset(idx, 85, sizeof(idx)); if (Tcl_GetIndexFromObjStruct(interp, (Tcl_GetString(objv[1])[0] ? objv[1] : NULL), ary, 2*sizeof(char *), - "dummy", flags, &idx[0]) != TCL_OK) { + "dummy", flags, &idx[1]) != TCL_OK) { return TCL_ERROR; } - if (idx[1] != 85) { - Tcl_AppendResult(interp, "Tcl_GetIndexFromObjStruct overwrites size", NULL); + if (idx[0] != 85 || idx[2] != 85) { + Tcl_AppendResult(interp, "Tcl_GetIndexFromObjStruct overwrites bytes near index variable", NULL); return TCL_ERROR; - } else if (idx[0] != target) { + } else if (idx[1] != target) { char buffer[64]; - sprintf(buffer, "%d", idx[0]); + sprintf(buffer, "%d", idx[1]); Tcl_AppendResult(interp, "index value comparison failed: got ", buffer, NULL); sprintf(buffer, "%d", target); |