diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp index 247b15acac0..25caee1b564 100644 --- a/icu4c/source/common/uloc.cpp +++ b/icu4c/source/common/uloc.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 1997-2011, International Business Machines +* Copyright (C) 1997-2012, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * @@ -706,7 +706,7 @@ _getKeywords(const char *localeID, pos++; } else { i = (int32_t)uprv_strlen(equalSign); - while(equalSign[i-1] == ' ') { + while(i && equalSign[i-1] == ' ') { i--; } keywordList[numKeywords].valueLen = i;