diff options
| author | Ondřej Surý <ondrej@sury.org> | 2012-07-23 10:51:19 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2012-07-23 10:51:19 +0200 |
| commit | 3365f28adf90110ca7475df889720fc244820f4b (patch) | |
| tree | 5415edde3e396a93f05f887d9f07071871467bdf /ext/intl/collator | |
| parent | f0f8d7084aec4be5c07f02f2e29c2820f85c8315 (diff) | |
| download | php-3365f28adf90110ca7475df889720fc244820f4b.tar.gz | |
Imported Upstream version 5.4.5upstream/5.4.5
Diffstat (limited to 'ext/intl/collator')
| -rwxr-xr-x | ext/intl/collator/collator_sort.c | 4 |
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); } /* }}} */ |
