+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
- * Copyright (c) 2001-2004, International Business Machines
+ * Copyright (c) 2001-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
#if !UCONFIG_NO_TRANSLITERATION
#include "unicode/uchar.h"
+#include "unicode/utf16.h"
#include "unesctrn.h"
#include "util.h"
}
++len;
UChar *result = (UChar *)uprv_malloc(len*sizeof(UChar));
- uprv_memcpy(result, spec, len*sizeof(result[0]));
+ // Check for memory allocation error.
+ if (result != NULL) {
+ uprv_memcpy(result, spec, (size_t)len*sizeof(result[0]));
+ }
return result;
}
if (digit < 0) {
break;
}
- s += UTF_CHAR_LENGTH(ch);
+ s += U16_LENGTH(ch);
u = (u * radix) + digit;
if (++digitCount == maxDigits) {
break;
}
if (start < limit) {
- start += UTF_CHAR_LENGTH(text.char32At(start));
+ start += U16_LENGTH(text.char32At(start));
}
}