Clean up internal clipboard handling
We now filter incoming data, which means we can start assuming the
clipboard data is always null terminated. This allows us to clean
up a lot of the internal handling.
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index 7820aef..21af0da 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -340,14 +340,14 @@
}
}
-void VNCServerST::serverCutText(const char* str, int len)
+void VNCServerST::serverCutText(const char* str)
{
- if (memchr(str, '\r', len) != NULL)
+ if (strchr(str, '\r') != NULL)
throw Exception("Invalid carriage return in clipboard data");
std::list<VNCSConnectionST*>::iterator ci, ci_next;
for (ci = clients.begin(); ci != clients.end(); ci = ci_next) {
ci_next = ci; ci_next++;
- (*ci)->serverCutTextOrClose(str, len);
+ (*ci)->serverCutTextOrClose(str);
}
}
@@ -461,9 +461,9 @@
desktop->pointerEvent(pos, buttonMask);
}
-void VNCServerST::clientCutText(const char* str, int len)
+void VNCServerST::clientCutText(const char* str)
{
- desktop->clientCutText(str, len);
+ desktop->clientCutText(str);
}
unsigned int VNCServerST::setDesktopSize(VNCSConnectionST* requester,