Bug 68990 - test-common fails on i686-linux

Fix use-after-end-of-scope.
This commit is contained in:
Behdad Esfahbod 2013-09-26 16:48:42 -04:00
parent b61f97d544
commit 48360ec03b
1 changed files with 4 additions and 2 deletions

View File

@ -292,11 +292,13 @@ retry:
hb_language_t
hb_language_from_string (const char *str, int len)
{
char strbuf[64];
if (!str || !len || !*str)
return HB_LANGUAGE_INVALID;
if (len >= 0) {
char strbuf[64];
if (len >= 0)
{
len = MIN (len, (int) sizeof (strbuf) - 1);
str = (char *) memcpy (strbuf, str, len);
strbuf[len] = '\0';