From: Behdad Esfahbod Date: Tue, 12 Oct 2010 16:32:18 +0000 (-0400) Subject: Fix infinite loop! X-Git-Tag: 2.0_alpha~7^2~509 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4792d99eee0e8cd72b7cb01c96a09f16e2a72ce;p=apps%2Fhome%2Fvideo-player.git Fix infinite loop! Untested code is indeed buggy code. Mozilla bug #603352. --- diff --git a/src/hb-ot-tag.c b/src/hb-ot-tag.c index 32d455d..c325802 100644 --- a/src/hb-ot-tag.c +++ b/src/hb-ot-tag.c @@ -630,13 +630,11 @@ hb_ot_tag_from_language (hb_language_t language) char tag[4]; int i; lang_str += 6; - i = 0; #define IS_LETTER(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) #define TO_UPPER(c) (((c) >= 'a' && (c) <= 'z') ? (c) + 'A' - 'a' : (c)) - while (i < 4 && IS_LETTER (lang_str[i])) { + for (i = 0; i < 4 && IS_LETTER (lang_str[i]); i++) tag[i] = TO_UPPER (lang_str[i]); - } - while (i < 4) + for (; i < 4; i++) tag[i] = ' '; return HB_TAG_STR (tag); }