Fixed some Visual Studio analyze warnings
This commit is contained in:
parent
6971a5dd1c
commit
de9566518f
3 changed files with 24 additions and 18 deletions
|
@ -77,15 +77,17 @@ WIN_SetClipboardText(_THIS, const char *text)
|
|||
hMem = GlobalAlloc(GMEM_MOVEABLE, size);
|
||||
if (hMem) {
|
||||
LPTSTR dst = (LPTSTR)GlobalLock(hMem);
|
||||
/* Copy the text over, adding carriage returns as necessary */
|
||||
for (i = 0; tstr[i]; ++i) {
|
||||
if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) {
|
||||
*dst++ = '\r';
|
||||
if (dst) {
|
||||
/* Copy the text over, adding carriage returns as necessary */
|
||||
for (i = 0; tstr[i]; ++i) {
|
||||
if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) {
|
||||
*dst++ = '\r';
|
||||
}
|
||||
*dst++ = tstr[i];
|
||||
}
|
||||
*dst++ = tstr[i];
|
||||
*dst = 0;
|
||||
GlobalUnlock(hMem);
|
||||
}
|
||||
*dst = 0;
|
||||
GlobalUnlock(hMem);
|
||||
|
||||
EmptyClipboard();
|
||||
if (!SetClipboardData(TEXT_FORMAT, hMem)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue