summaryrefslogtreecommitdiffstats
path: root/generic/tclBinary.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-02-27 14:17:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-02-27 14:17:02 (GMT)
commit5c1edaba5f9c06f4e9aab4c519a4bb0f6e4cd5dc (patch)
tree1e0ef952c9c3e4dac0efdf2dff1553b1789a3b81 /generic/tclBinary.c
parent99609e43fae4d5bfc486a7c3b61d26b29d792389 (diff)
parente4c5dbbeada1c721698d68ec85c03e5bfade1592 (diff)
downloadtcl-5c1edaba5f9c06f4e9aab4c519a4bb0f6e4cd5dc.zip
tcl-5c1edaba5f9c06f4e9aab4c519a4bb0f6e4cd5dc.tar.gz
tcl-5c1edaba5f9c06f4e9aab4c519a4bb0f6e4cd5dc.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclBinary.c')
-rw-r--r--generic/tclBinary.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 429f7c1..314e9fd 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -208,7 +208,7 @@ TclIsPureByteArray(
* from the given array of bytes.
*
* Results:
- * The newly create object is returned. This object will have no initial
+ * The newly created object is returned. This object has no initial
* string representation. The returned object has a ref count of 0.
*
* Side effects:
@@ -223,7 +223,8 @@ Tcl_Obj *
Tcl_NewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
- Tcl_Size numBytes) /* Number of bytes in the array */
+ Tcl_Size numBytes) /* Number of bytes in the array,
+ * must be >= 0. */
{
#ifdef TCL_MEM_DEBUG
return Tcl_DbNewByteArrayObj(bytes, numBytes, "unknown", 0);
@@ -266,7 +267,8 @@ Tcl_Obj *
Tcl_DbNewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
- Tcl_Size numBytes, /* Number of bytes in the array */
+ Tcl_Size numBytes, /* Number of bytes in the array,
+ * must be >= 0. */
const char *file, /* The name of the source file calling this
* procedure; used for debugging. */
int line) /* Line number in the source file; used for
@@ -283,7 +285,8 @@ Tcl_Obj *
Tcl_DbNewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
- Tcl_Size numBytes, /* Number of bytes in the array */
+ Tcl_Size numBytes, /* Number of bytes in the array,
+ * must be >= 0. */
TCL_UNUSED(const char *) /*file*/,
TCL_UNUSED(int) /*line*/)
{
@@ -314,8 +317,8 @@ Tcl_SetByteArrayObj(
Tcl_Obj *objPtr, /* Object to initialize as a ByteArray. */
const unsigned char *bytes, /* The array of bytes to use as the new value.
* May be NULL even if numBytes > 0. */
- Tcl_Size numBytes) /* Number of bytes in the array.
- * Must be >= 0 */
+ Tcl_Size numBytes) /* Number of bytes in the array,
+ * must be >= 0 */
{
ByteArray *byteArrayPtr;
Tcl_ObjInternalRep ir;
@@ -1405,7 +1408,7 @@ BinaryScanCmd(
if (count == BINARY_NOCOUNT) {
count = 1;
}
- if (count > length - offset) {
+ if (count > (length - offset)) {
goto done;
}
}
@@ -1603,7 +1606,7 @@ BinaryScanCmd(
goto badIndex;
}
if (count == BINARY_NOCOUNT) {
- if (length < size + offset) {
+ if (length < (size + offset)) {
goto done;
}
valuePtr = ScanNumber(buffer+offset, cmd, flags,