summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--string.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 93bb47ccef..a0dc2d4fb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/string.c b/string.c
index 96b5d9cc7f..1270f502a8 100644
--- a/string.c
+++ b/string.c
@@ -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));