icu/Collate: initialize the error code before ucol_open()

Fixes initialization failure.
This commit is contained in:
Max Kellermann 2014-02-24 21:04:23 +01:00
parent 33fc3af775
commit 1e63e7c08b

View File

@ -48,7 +48,7 @@ IcuCollateInit(Error &error)
assert(collator == nullptr);
assert(!error.IsDefined());
UErrorCode code;
UErrorCode code = U_ZERO_ERROR;
collator = ucol_open("", &code);
if (collator == nullptr) {
error.Format(icu_domain, int(code),