diff options
Diffstat (limited to 'generic/tclBinary.c')
| -rw-r--r-- | generic/tclBinary.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 28cf31d..d53fc64 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -978,11 +978,10 @@ BinaryFormatCmd( * The macro evals its args more than once: avoid arg++ */ - if (TclListObjGetElementsM(interp, objv[arg], &listc, - &listv) != TCL_OK) { + if (TclListObjLengthM(interp, objv[arg], &listc + ) != TCL_OK) { return TCL_ERROR; } - arg++; if (count == BINARY_ALL) { count = listc; @@ -992,6 +991,11 @@ BinaryFormatCmd( -1)); return TCL_ERROR; } + if (TclListObjGetElementsM(interp, objv[arg], &listc, + &listv) != TCL_OK) { + return TCL_ERROR; + } + arg++; } offset += count*size; break; |
