From eb81df537cc56f9d2fdd8fbd8d91d1b166009b61 Mon Sep 17 00:00:00 2001 From: Travis Keep Date: Mon, 26 Nov 2012 22:29:27 +0000 Subject: [PATCH] ICU-9669 Roll back change 32889 X-SVN-Rev: 32890 --- icu4c/source/common/uresbund.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/icu4c/source/common/uresbund.cpp b/icu4c/source/common/uresbund.cpp index 5bed3fb679a..0404e36a821 100644 --- a/icu4c/source/common/uresbund.cpp +++ b/icu4c/source/common/uresbund.cpp @@ -1670,20 +1670,13 @@ ures_getStringByKeyWithFallback(const UResourceBundle *resB, const UChar* retVal = NULL; ures_initStackObject(&stack); ures_getByKeyWithFallback(resB, inKey, &stack, status); - int32_t length; - retVal = ures_getString(&stack, &length, status); + retVal = ures_getString(&stack, len, status); ures_close(&stack); - if (U_FAILURE(*status)) { - return NULL; - } - if (length == 3 && retVal[0] == EMPTY_SET && retVal[1] == EMPTY_SET && retVal[2] == EMPTY_SET ) { + if ( retVal != NULL && u_strlen(retVal) == 3 && retVal[0] == EMPTY_SET && retVal[1] == EMPTY_SET && retVal[2] == EMPTY_SET ) { retVal = NULL; - length = 0; + *len = 0; *status = U_MISSING_RESOURCE_ERROR; } - if (len != NULL) { - *len = length; - } return retVal; }