From 765d0572a24fc454989ec119cbaa1c089cd34bfa Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 24 May 2009 05:21:56 +0000 Subject: - Patch #471142 by stella: code style fixes. --- includes/unicode.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'includes/unicode.inc') diff --git a/includes/unicode.inc b/includes/unicode.inc index f25f472d2..8c2f64970 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -207,7 +207,9 @@ function drupal_truncate_bytes($string, $len) { if ((ord($string[$len]) < 0x80) || (ord($string[$len]) >= 0xC0)) { return substr($string, 0, $len); } - while (--$len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0) {}; + // Scan backwards to beginning of the byte sequence. + while (--$len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0); + return substr($string, 0, $len); } -- cgit v1.2.3