Fix errors reported by clang

SVN revision: 50492
This commit is contained in:
Sebastian Dransfeld 2010-07-25 20:25:40 +00:00
parent e43175fa37
commit b76d9490dc
2 changed files with 4 additions and 4 deletions

View File

@ -585,7 +585,7 @@ efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, const char *value)
if (country) maxlen += strlen(country);
if (modifier) maxlen += strlen(modifier);
buf = malloc(maxlen * sizeof(char));
buf = alloca(maxlen);
if (lang && modifier && country)
snprintf(buf, maxlen, "%s[%s_%s@%s]", key, lang, country, modifier);
@ -596,10 +596,9 @@ efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, const char *value)
else if (lang)
snprintf(buf, maxlen, "%s[%s]", key, lang);
else
return;
goto error;
efreet_ini_string_set(ini, buf, value);
FREE(buf);
}
/**

View File

@ -1149,6 +1149,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
case '=':
ptr++;
tshort = 0;
memcpy(&tshort, ptr, sizeof(short));
entry->value_len = ntohs(tshort);
ptr += 2;
@ -1299,7 +1300,7 @@ efreet_mime_magic_check_priority(const char *file,
else if ((level > e->indent) && match)
{
fclose(f);
if (last_mime) return last_mime;
return last_mime;
}
for (offset = e->offset; offset < e->offset + e->range_len; offset++)