Skip to content

Commit

Permalink
Fix link len caculation and copy link
Browse files Browse the repository at this point in the history
  • Loading branch information
craftwar committed Aug 27, 2018
1 parent 7b9ed1a commit 84ef691
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lite/BBSHyperLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const char* CBBSHyperLink::FindHyperLink(const char *src, int &len) const
break;
}
}
len = int(pend) - int(plink);
len = int(pend - plink);
return plink;
}
}
Expand Down
3 changes: 2 additions & 1 deletion Lite/Clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ BOOL CClipboard::SetText(HWND owner, LPCTSTR str, int len)
{
LPSTR buf = (LPSTR)GlobalLock(hmem);
PLCID lcid = (PLCID)GlobalLock(hlocmem);
memcpy(buf, str, len + 1);
memcpy(buf, str, len);
buf[len] = '\0';
// FIXME: Big5 should not be hard-coded since we have GB2312 version.
*lcid = MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL), SORT_CHINESE_BIG5);
GlobalUnlock(hmem);
Expand Down

0 comments on commit 84ef691

Please sign in to comment.