summaryrefslogtreecommitdiffstats
path: root/generic/tclBinary.c
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2022-07-31 06:32:22 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2022-07-31 06:32:22 (GMT)
commitd2518017c7f55b82f10c7ee1e77cbe27218cc857 (patch)
tree6ed28530bb059df23572a55b298e9cbe740a6a27 /generic/tclBinary.c
parent3674905dbda8443171db562a6c69bf50228f18fb (diff)
parent13384df4afe1602c77e79a0661eb8f70419f1697 (diff)
downloadtcl-d2518017c7f55b82f10c7ee1e77cbe27218cc857.zip
tcl-d2518017c7f55b82f10c7ee1e77cbe27218cc857.tar.gz
tcl-d2518017c7f55b82f10c7ee1e77cbe27218cc857.tar.bz2
Merged trunk.
Diffstat (limited to 'generic/tclBinary.c')
-rw-r--r--generic/tclBinary.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 90efc9f..a7d6617 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -341,7 +341,7 @@ Tcl_SetByteArrayObj(
*
* Attempt to extract the value from objPtr in the representation
* of a byte sequence. On success return the extracted byte sequence.
- * On failures, return NULL and record error message and code in
+ * On failure, return NULL and record error message and code in
* interp (if not NULL).
*
* Results:
@@ -872,8 +872,7 @@ BinaryFormatCmd(
* cursor has visited.*/
const char *errorString;
const char *errorValue, *str;
- size_t offset, size;
- size_t length;
+ size_t offset, size, length;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
@@ -1379,8 +1378,7 @@ BinaryScanCmd(
unsigned char *buffer; /* Start of result buffer. */
const char *errorString;
const char *str;
- size_t offset, size, i;
- size_t length = 0;
+ size_t offset, size, length = 0, i;
Tcl_Obj *valuePtr, *elementPtr;
Tcl_HashTable numberCacheHash;
@@ -1656,7 +1654,7 @@ BinaryScanCmd(
if (count == BINARY_NOCOUNT) {
count = 1;
}
- if ((count == BINARY_ALL) || (count > length - offset)) {
+ if ((count == BINARY_ALL) || (count > (length - offset))) {
offset = length;
} else {
offset += count;