eolian: fix coverity defects

This commit is contained in:
Daniel Kolesa 2014-07-09 10:19:36 +01:00
parent c65918eaed
commit 892c5cba5f
3 changed files with 6 additions and 3 deletions

View File

@ -143,7 +143,7 @@ _generate_impl_c_file(char *filename, const Eolian_Class class)
ERR("Couldnt allocate memory for file %s", filename);
goto end;
}
if (0 == fread(content, file_size, 1, fd))
if (!fread(content, file_size, 1, fd))
{
ERR("Couldnt read the %ld bytes of file %s", file_size, filename);
free(content);

View File

@ -357,7 +357,7 @@ parse_typedef(Eo_Lexer *ls)
check(ls, TOK_VALUE);
ls->tmp.typedef_def->alias = eina_stringshare_add(ls->t.value);
eo_lexer_get(ls);
test_next(ls, ':');
(void)!!test_next(ls, ':');
ls->tmp.typedef_def->type = parse_type_struct_nonvoid(ls, EINA_TRUE,
EINA_TRUE);
ls->tmp.type_def = NULL;

View File

@ -1628,12 +1628,15 @@ static char *
join_path(const char *path, const char *file)
{
Eina_Strbuf *buf = eina_strbuf_new();
char *ret;
eina_strbuf_append(buf, path);
eina_strbuf_append_char(buf, '/');
eina_strbuf_append(buf, file);
return eina_strbuf_string_steal(buf);
ret = eina_strbuf_string_steal(buf);
eina_strbuf_free(buf);
return ret;
}
static void