diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-04 03:14:57 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-04 03:14:57 +0000 |
commit | e0d1e2453b35f4b8ed4d57fd0205538fec3babb6 (patch) | |
tree | bd10171a346a4fb483c2a19168b8155ab11909dc | |
parent | aa36d4df21113a36c2e368e0abb417480a6eebbd (diff) | |
download | ruby-e0d1e2453b35f4b8ed4d57fd0205538fec3babb6.tar.gz |
* string.c (str_utf8_nth): fixed a conditon of optimized lead
byte counting. [Bug #4366][ruby-dev:43170]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | string.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Feb 4 12:11:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * string.c (str_utf8_nth): fixed a conditon of optimized lead + byte counting. [Bug #4366][ruby-dev:43170] + Fri Feb 4 01:50:13 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> * string.c (count_utf8_lead_bytes_with_word): wrote function @@ -1548,7 +1548,7 @@ static char * str_utf8_nth(const char *p, const char *e, long *nthp) { long nth = *nthp; - if ((int)SIZEOF_VALUE < e - p && (int)SIZEOF_VALUE * 2 < nth) { + if ((int)SIZEOF_VALUE * 2 < e - p && (int)SIZEOF_VALUE * 2 < nth) { const VALUE *s, *t; const VALUE lowbits = sizeof(VALUE) - 1; s = (const VALUE*)(~lowbits & ((VALUE)p + lowbits)); |