mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 04:29:31 +00:00
ICU-410 preflighting crashed when destCapacity>0 (oops, did this yesterday?)
X-SVN-Rev: 2307
This commit is contained in:
parent
8940d6fe91
commit
faa2a512ef
1 changed files with 9 additions and 5 deletions
|
@ -534,8 +534,10 @@ u_unescape(const char *src, UChar *dest, int32_t destCapacity) {
|
|||
int32_t lenParsed = 0;
|
||||
UChar32 c32;
|
||||
if (src != segment) {
|
||||
_appendUChars(dest + i, destCapacity - i,
|
||||
segment, src - segment);
|
||||
if (dest != NULL) {
|
||||
_appendUChars(dest + i, destCapacity - i,
|
||||
segment, src - segment);
|
||||
}
|
||||
i += src - segment;
|
||||
}
|
||||
++src; /* advance past '\\' */
|
||||
|
@ -555,11 +557,13 @@ u_unescape(const char *src, UChar *dest, int32_t destCapacity) {
|
|||
}
|
||||
}
|
||||
if (src != segment) {
|
||||
_appendUChars(dest + i, destCapacity - i,
|
||||
segment, src - segment);
|
||||
if (dest != NULL) {
|
||||
_appendUChars(dest + i, destCapacity - i,
|
||||
segment, src - segment);
|
||||
}
|
||||
i += src - segment;
|
||||
}
|
||||
if (i < destCapacity) {
|
||||
if (dest != NULL && i < destCapacity) {
|
||||
dest[i] = 0;
|
||||
}
|
||||
return i + 1; /* add 1 for zero term */
|
||||
|
|
Loading…
Add table
Reference in a new issue