From b1fca97b2f2f9a6b32f8c7385aee92d1f1692fff Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Thu, 6 Sep 2007 19:21:55 +0000 Subject: [PATCH] ICU-5919 Fixes for old iostream usage on an older HP-UX machine. X-SVN-Rev: 22636 --- icu4c/source/i18n/vtzone.cpp | 3 ++- icu4c/source/io/ustream.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/icu4c/source/i18n/vtzone.cpp b/icu4c/source/i18n/vtzone.cpp index c8aa367aea6..68c659f234f 100644 --- a/icu4c/source/i18n/vtzone.cpp +++ b/icu4c/source/i18n/vtzone.cpp @@ -1312,6 +1312,7 @@ VTimeZone::parse(UErrorCode& status) { UnicodeString tzid; int32_t state = INI; + int32_t n = 0; UBool dst = FALSE; // current zone type UnicodeString from; // current zone from offset UnicodeString to; // current zone offset @@ -1336,7 +1337,7 @@ VTimeZone::parse(UErrorCode& status) { goto cleanupParse; } - for (int32_t n = 0; n < vtzlines->size(); n++) { + for (n = 0; n < vtzlines->size(); n++) { UnicodeString *line = (UnicodeString*)vtzlines->elementAt(n); int32_t valueSep = line->indexOf(COLON); if (valueSep < 0) { diff --git a/icu4c/source/io/ustream.cpp b/icu4c/source/io/ustream.cpp index ba7919bd7a4..e9f57643d92 100644 --- a/icu4c/source/io/ustream.cpp +++ b/icu4c/source/io/ustream.cpp @@ -115,8 +115,8 @@ operator>>(STD_ISTREAM& stream, UnicodeString& str) */ ucnv_toUnicode(converter, &us, uLimit, &s, sLimit, 0, !continueReading, &errorCode); if(U_FAILURE(errorCode)) { - /* Something really bad happened */ - stream.setstate(stream.failbit); + /* Something really bad happened. setstate() isn't always an available API */ + stream.clear(stream.failbit); goto STOP_READING; } /* Was the character consumed? */