summaryrefslogtreecommitdiffstats
path: root/generic/tkClipboard.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-10 10:10:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-10 10:10:53 (GMT)
commit036578f0f387a74a06b7b33e0473f7b810fbb2a7 (patch)
treec9942d0c2666ed4946c947d96f012e3de66289f0 /generic/tkClipboard.c
parentf82ef1431a93849d487f845bc8f314ef8d595669 (diff)
downloadtk-036578f0f387a74a06b7b33e0473f7b810fbb2a7.zip
tk-036578f0f387a74a06b7b33e0473f7b810fbb2a7.tar.gz
tk-036578f0f387a74a06b7b33e0473f7b810fbb2a7.tar.bz2
According to documentation, maxBytes is exclusing the end 0-byte, so previous commit was a little too strict
Diffstat (limited to 'generic/tkClipboard.c')
-rw-r--r--generic/tkClipboard.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c
index a6c4275..2e504eb 100644
--- a/generic/tkClipboard.c
+++ b/generic/tkClipboard.c
@@ -144,8 +144,8 @@ ClipboardAppHandler(
if (length <= 0) {
return 0;
}
- if (length >= (size_t) maxBytes) {
- length = maxBytes - 1;
+ if (length > (size_t) maxBytes) {
+ length = maxBytes;
}
memcpy(buffer, p, length);
buffer[length] = 0;