ICU-5161 Fix Purify/valgrind warnings about uninitialized memory reading.

X-SVN-Rev: 19551
This commit is contained in:
George Rhoten 2006-04-15 07:52:16 +00:00
parent 8530362290
commit ac0ec58b80

View File

@ -1,7 +1,7 @@
/* /*
******************************************************************************* *******************************************************************************
* *
* Copyright (C) 1997-2004, International Business Machines * Copyright (C) 1997-2006, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
******************************************************************************* *******************************************************************************
@ -47,6 +47,8 @@ ResourceBundle::constructForLocale(const UnicodeString& path,
} }
else { else {
UnicodeString nullTerminatedPath(path); UnicodeString nullTerminatedPath(path);
nullTerminatedPath.append((UChar)0);
nullTerminatedPath.truncate(nullTerminatedPath.length()-1);
fResource = ures_openU(nullTerminatedPath.getTerminatedBuffer(), locale.getName(), &error); fResource = ures_openU(nullTerminatedPath.getTerminatedBuffer(), locale.getName(), &error);
} }
} }