VirtualBox

Changeset 57189 in vbox


Ignore:
Timestamp:
Aug 5, 2015 10:50:04 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101941
Message:

Runtime/RTUtf16Copy: Fix implementation, would only copy half of the requested amount before

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/RTUtf16Copy.cpp

    r56290 r57189  
    3838    if (RT_LIKELY(wcwSrc < cwcDst))
    3939    {
    40         memcpy(pwszDst, pwszSrc, wcwSrc + 1);
     40        memcpy(pwszDst, pwszSrc, (wcwSrc + 1) * sizeof(RTUTF16));
    4141        return VINF_SUCCESS;
    4242    }
     
    4444    if (cwcDst != 0)
    4545    {
    46         memcpy(pwszDst, pwszSrc, cwcDst - 1);
     46        memcpy(pwszDst, pwszSrc, (cwcDst - 1) * sizeof(RTUTF16));
    4747        pwszDst[cwcDst - 1] = '\0';
    4848    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette