summaryrefslogtreecommitdiff
path: root/ext/intl/collator
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-07-23 10:51:19 +0200
committerOndřej Surý <ondrej@sury.org>2012-07-23 10:51:19 +0200
commit3365f28adf90110ca7475df889720fc244820f4b (patch)
tree5415edde3e396a93f05f887d9f07071871467bdf /ext/intl/collator
parentf0f8d7084aec4be5c07f02f2e29c2820f85c8315 (diff)
downloadphp-3365f28adf90110ca7475df889720fc244820f4b.tar.gz
Imported Upstream version 5.4.5upstream/5.4.5
Diffstat (limited to 'ext/intl/collator')
-rwxr-xr-xext/intl/collator/collator_sort.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index a871c90a8..0785111c9 100755
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -594,6 +594,8 @@ PHP_FUNCTION( collator_get_sort_key )
RETURN_FALSE;
}
+ /* ucol_getSortKey is exception in that the key length includes the
+ * NUL terminator*/
key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, key, 0);
if(!key_len) {
efree( ustr );
@@ -605,7 +607,7 @@ PHP_FUNCTION( collator_get_sort_key )
if(!key_len) {
RETURN_FALSE;
}
- RETURN_STRINGL((char *)key, key_len, 0);
+ RETURN_STRINGL((char *)key, key_len - 1, 0);
}
/* }}} */