summaryrefslogtreecommitdiff
path: root/src/w16select.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>1999-02-02 13:43:14 +0000
committerEli Zaretskii <eliz@gnu.org>1999-02-02 13:43:14 +0000
commit0236e3f15175a263f3c768d7a8431c7b80248aab (patch)
tree903182d40faa6b9b4be3ed9dcf149091173a0071 /src/w16select.c
parent64d9f69a35755e546b3ca62e583c783750a5d6aa (diff)
downloademacs-0236e3f15175a263f3c768d7a8431c7b80248aab.tar.gz
(set_clipboard_data): Correctly null-terminate the
string to be put into the Windows clipboard. Use xbuf_addr.
Diffstat (limited to 'src/w16select.c')
-rw-r--r--src/w16select.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/w16select.c b/src/w16select.c
index 5f9ce1b64a7..e94a420d1a4 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -263,7 +263,13 @@ set_clipboard_data (Format, Data, Size, Raw)
/* Move the buffer into the low memory, convert LF into CR-LF if needed. */
if (Raw)
- dosmemput (Data, truelen, __tb);
+ {
+ dosmemput (Data, Size, xbuf_addr);
+
+ /* Terminate with a null, otherwise Windows does strange things
+ when the text size is an integral multiple of 32 bytes. */
+ _farpokeb (_dos_ds, xbuf_addr + Size, '\0');
+ }
else
{
dp = Data;
@@ -279,11 +285,11 @@ set_clipboard_data (Format, Data, Size, Raw)
_farnspokeb (buf_offset++, '\r');
_farnspokeb (buf_offset++, *dp++);
}
- }
- /* Terminate with a null, otherwise Windows does strange things when
- the text size is an integral multiple of 32 bytes. */
- _farnspokeb (buf_offset, *dp);
+ /* Terminate with a null, otherwise Windows does strange things
+ when the text size is an integral multiple of 32 bytes. */
+ _farnspokeb (buf_offset, '\0');
+ }
/* Calls Int 2Fh/AX=1703h with:
DX = WinOldAp-Supported Clipboard format