Merge branch 'coverity-return-values' into 'master'

Fix minor Coverity return value warnings

See merge request GNOME/glib!1748
This commit is contained in:
Sebastian Dröge 2020-11-13 15:24:47 +00:00
commit e4721dfff5
2 changed files with 6 additions and 3 deletions

View File

@ -10,6 +10,7 @@ int
main (int argc, char **argv)
{
FILE *f;
long tell_result;
size_t n_read, len;
unsigned char *buf;
@ -19,7 +20,9 @@ main (int argc, char **argv)
f = fopen (argv[1], "r");
assert (f);
fseek (f, 0, SEEK_END);
len = ftell (f);
tell_result = ftell (f);
assert (tell_result >= 0);
len = (size_t) tell_result;
fseek (f, 0, SEEK_SET);
buf = (unsigned char*) malloc (len);
n_read = fread (buf, 1, len, f);

View File

@ -1297,8 +1297,8 @@ rm_rf (const gchar *path)
dir = g_dir_open (path, 0, NULL);
if (dir == NULL)
{
/* Assume its a file. */
g_remove (path);
/* Assume its a file. Ignore failure. */
(void) g_remove (path);
return;
}