blob: 4243370c9ac41641623e3ba03dab00d8dddc21c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
--- ./common/uloc.c.orig
+++ ./common/uloc.c
@@ -1797,7 +1797,7 @@
int32_t variantLen = _deleteVariant(variant, uprv_min(variantSize, (nameCapacity-len)), variantToCompare, n);
len -= variantLen;
if (variantLen > 0) {
- if (name[len-1] == '_') { /* delete trailing '_' */
+ if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
--len;
}
addKeyword = VARIANT_MAP[j].keyword;
@@ -1805,7 +1805,7 @@
break;
}
}
- if (name[len-1] == '_') { /* delete trailing '_' */
+ if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
--len;
}
}
|