提交 f4792d99 编写于 作者: B Behdad Esfahbod

Fix infinite loop!

Untested code is indeed buggy code.

Mozilla bug #603352.
上级 993d1e78
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册