fixed a bug of not checking the return value of wcrtomb properly in qse_wcrtomb().

fixed a bug of passing a wrong buffer to qse_wcrtomb() in qse_wcsntombsn().
enhanced qse_tio_writembsn() and qse_tio_writewcsn()
This commit is contained in:
2011-12-13 15:48:00 +00:00
parent 283f388ae9
commit 7f0ad74286
23 changed files with 278 additions and 165 deletions

View File

@ -4,8 +4,6 @@
#include <qse/cmn/sio.h>
#include <locale.h>
#include <wchar.h>
#include <string.h>
#if defined(_WIN32)
# include <windows.h>
@ -161,30 +159,6 @@ static int test4 ()
return 0;
}
static int test10 (void)
{
qse_wchar_t* wa[] = { QSE_WT("hello"), QSE_WT(","), QSE_WT("world"), QSE_NULL };
qse_mchar_t* ma[] = { QSE_MT("HELLO"), QSE_MT(","), QSE_MT("WORLD"), QSE_NULL };
qse_wchar_t* w;
qse_mchar_t* m;
m = qse_wcsatombsdup (wa, QSE_MMGR_GETDFL());
if (m)
{
qse_printf (QSE_T("[%ms]\n"), m);
QSE_MMGR_FREE (QSE_MMGR_GETDFL(), m);
}
w = qse_mbsatowcsdup (ma, QSE_MMGR_GETDFL());
if (w)
{
qse_printf (QSE_T("[%ws]\n"), w);
QSE_MMGR_FREE (QSE_MMGR_GETDFL(), w);
}
return 0;
}
static int test11 (void)
{
qse_char_t buf[1000];
@ -418,7 +392,6 @@ int main ()
R (test2);
R (test3);
R (test4);
R (test10);
R (test11);
R (test12);