diff options
| author | Ondřej Surý <ondrej@sury.org> | 2012-05-31 10:55:48 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2012-05-31 10:55:48 +0200 |
| commit | 90ceaa9e92fadfef4c21ec0f76063c4387beb561 (patch) | |
| tree | 42c54fe576b4513fa12eb949ce67bda472411abc /ext/intl/collator | |
| parent | 01c525f668ecff08bea21c4ff22745b8f77e8c3a (diff) | |
| download | php-90ceaa9e92fadfef4c21ec0f76063c4387beb561.tar.gz | |
Imported Upstream version 5.4.4~rc2upstream/5.4.4_rc2
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); } /* }}} */ |
