Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c7f8e71a
Commit
c7f8e71a
authored
Oct 20, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Oct 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Fix some bytes-vs-WCHARs length computation bugs in the UTF-16 clipboard support.
parent
0153a962
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
clipboard.c
dlls/winemac.drv/clipboard.c
+4
-4
No files found.
dlls/winemac.drv/clipboard.c
View file @
c7f8e71a
...
...
@@ -1007,7 +1007,7 @@ static HANDLE import_utf16_to_unicodetext(CFDataRef data)
HANDLE
unicode_handle
;
src
=
(
const
WCHAR
*
)
CFDataGetBytePtr
(
data
);
data_len
=
CFDataGetLength
(
data
);
data_len
=
CFDataGetLength
(
data
)
/
sizeof
(
WCHAR
)
;
for
(
i
=
0
;
i
<
data_len
;
i
++
)
{
if
(
src
[
i
]
==
'\n'
)
...
...
@@ -1358,13 +1358,13 @@ static CFDataRef export_unicodetext_to_utf16(HANDLE data)
dst_len
=
GlobalSize
(
data
)
/
sizeof
(
WCHAR
);
if
(
dst_len
)
dst_len
--
;
/* Leave off null terminator. */
ret
=
CFDataCreateMutable
(
NULL
,
dst_len
);
ret
=
CFDataCreateMutable
(
NULL
,
dst_len
*
sizeof
(
WCHAR
)
);
if
(
ret
)
{
LPWSTR
dst
;
int
i
,
j
;
CFDataSetLength
(
ret
,
dst_len
);
CFDataSetLength
(
ret
,
dst_len
*
sizeof
(
WCHAR
)
);
dst
=
(
LPWSTR
)
CFDataGetMutableBytePtr
(
ret
);
/* Remove carriage returns */
...
...
@@ -1375,7 +1375,7 @@ static CFDataRef export_unicodetext_to_utf16(HANDLE data)
continue
;
dst
[
j
++
]
=
src
[
i
];
}
CFDataSetLength
(
ret
,
j
);
CFDataSetLength
(
ret
,
j
*
sizeof
(
WCHAR
)
);
}
GlobalUnlock
(
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment