mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-04 00:36:36 +00:00
Fix improper null termination when stripping clipboard text
This commit is contained in:
parent
f2bcb49478
commit
0870dd15a8
@ -107,7 +107,9 @@ void SdlInputHandler::performSpecialKeyCombo(KeyCombo combo)
|
|||||||
// each newline in the source, so we fix up any CRLFs into just a single LF.
|
// each newline in the source, so we fix up any CRLFs into just a single LF.
|
||||||
for (char* c = text; *c != 0; c++) {
|
for (char* c = text; *c != 0; c++) {
|
||||||
if (*c == '\r' && *(c + 1) == '\n') {
|
if (*c == '\r' && *(c + 1) == '\n') {
|
||||||
memmove(c, c + 1, strlen(c) - 1);
|
// We're using strlen() rather than strlen() - 1 since we need to add 1
|
||||||
|
// to copy the null terminator which is not included in strlen()'s count.
|
||||||
|
memmove(c, c + 1, strlen(c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user