Module: wine Branch: master Commit: f91c8578bb6ccb8af25d08387bb48ad86529ec7e URL: http://source.winehq.org/git/wine.git/?a=commit;h=f91c8578bb6ccb8af25d08387b...
Author: Dan Kegel dank@kegel.com Date: Mon Oct 17 08:24:40 2011 -0700
mlang/tests: Don't call lstrcpyW on a null string.
---
dlls/mlang/tests/mlang.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c index 651d45a..42ad1f8 100644 --- a/dlls/mlang/tests/mlang.c +++ b/dlls/mlang/tests/mlang.c @@ -1203,21 +1203,25 @@ static void test_GetRfc1766Info(IMultiLanguage2 *iML2) "#%02d: got '%s' (expected '%s')\n", i, rfc1766A, info_table[i].rfc1766);
/* Some IE versions truncate an oversized name one character to short */ - lstrcpyW(short_broken_name, info_table[i].broken_name); - short_broken_name[MAX_LOCALE_NAME - 2] = '\0'; + if (info_table[i].broken_name) { + lstrcpyW(short_broken_name, info_table[i].broken_name); + short_broken_name[MAX_LOCALE_NAME - 2] = 0; + }
if (info_table[i].todo & TODO_NAME) { todo_wine ok( (!lstrcmpW(prfc->wszLocaleName, info_table[i].localename)) || + (info_table[i].broken_name && ( broken(!lstrcmpW(prfc->wszLocaleName, info_table[i].broken_name)) || /* IE < 6.0 */ - broken(!lstrcmpW(prfc->wszLocaleName, short_broken_name)), + broken(!lstrcmpW(prfc->wszLocaleName, short_broken_name)))), "#%02d: got %s (expected %s)\n", i, wine_dbgstr_w(prfc->wszLocaleName), wine_dbgstr_w(info_table[i].localename)); } else ok( (!lstrcmpW(prfc->wszLocaleName, info_table[i].localename)) || + (info_table[i].broken_name && ( broken(!lstrcmpW(prfc->wszLocaleName, info_table[i].broken_name)) || /* IE < 6.0 */ - broken(!lstrcmpW(prfc->wszLocaleName, short_broken_name)), + broken(!lstrcmpW(prfc->wszLocaleName, short_broken_name)))), "#%02d: got %s (expected %s)\n", i, wine_dbgstr_w(prfc->wszLocaleName), wine_dbgstr_w(info_table[i].localename));