From e0d1e2453b35f4b8ed4d57fd0205538fec3babb6 Mon Sep 17 00:00:00 2001 From: kosaki Date: Fri, 4 Feb 2011 03:14:57 +0000 Subject: * 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 --- string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string.c') 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)); -- cgit v1.2.3