ICU-2329 always NUL-terminate the ID string for ID enumeration in C APIs
X-SVN-Rev: 12587
This commit is contained in:
parent
9ec6b45611
commit
bd62571a6c
@ -655,7 +655,10 @@ void TransliteratorRegistry::registerEntry(const UnicodeString& ID,
|
||||
if (visible) {
|
||||
registerSTV(source, target, variant);
|
||||
if (!availableIDs.contains((void*) &ID)) {
|
||||
availableIDs.addElement(new UnicodeString(ID), status);
|
||||
UnicodeString *newID = (UnicodeString *)ID.clone();
|
||||
// NUL-terminate the ID string
|
||||
newID->getTerminatedBuffer();
|
||||
availableIDs.addElement(newID, status);
|
||||
}
|
||||
} else {
|
||||
removeSTV(source, target, variant);
|
||||
|
@ -1241,6 +1241,8 @@ inline int32_t Transliterator::getMaximumContextLength(void) const {
|
||||
|
||||
inline void Transliterator::setID(const UnicodeString& id) {
|
||||
ID = id;
|
||||
// NUL-terminate the ID string
|
||||
ID.getTerminatedBuffer();
|
||||
}
|
||||
|
||||
inline Transliterator::Token Transliterator::integerToken(int32_t i) {
|
||||
|
Loading…
Reference in New Issue
Block a user