git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2275
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
((wxCSConv *)this)->LoadNow(); // discard constness
if (buf) {
if (m_cset) {
((wxCSConv *)this)->LoadNow(); // discard constness
if (buf) {
if (m_cset) {
- for (size_t c=0; c<=n; c++)
+ for (size_t c=0; c<n; c++)
buf[c] = m_cset->data[psz[c]];
} else {
// latin-1 (direct)
buf[c] = m_cset->data[psz[c]];
} else {
// latin-1 (direct)
- for (size_t c=0; c<=n; c++)
+ for (size_t c=0; c<n; c++)
}
size_t wxCSConv::WC2MB(char *buf, const wchar_t *psz, size_t n) const
}
size_t wxCSConv::WC2MB(char *buf, const wchar_t *psz, size_t n) const
((wxCSConv *)this)->LoadNow(); // discard constness
if (buf) {
if (m_cset) {
((wxCSConv *)this)->LoadNow(); // discard constness
if (buf) {
if (m_cset) {
- for (size_t c=0; c<=n; c++) {
+ for (size_t c=0; c<n; c++) {
size_t n;
for (n=0; (n<256) && (m_cset->data[n] != psz[c]); n++);
buf[c] = (n>0xff) ? '?' : n;
}
} else {
// latin-1 (direct)
size_t n;
for (n=0; (n<256) && (m_cset->data[n] != psz[c]); n++);
buf[c] = (n>0xff) ? '?' : n;
}
} else {
// latin-1 (direct)
- for (size_t c=0; c<=n; c++)
+ for (size_t c=0; c<n; c++)
buf[c] = (psz[c]>0xff) ? '?' : psz[c];
}
buf[c] = (psz[c]>0xff) ? '?' : psz[c];
}