mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-11 03:46:17 +01:00
Merge branch 'coverity-return-values' into 'master'
Fix minor Coverity return value warnings See merge request GNOME/glib!1748
This commit is contained in:
commit
e4721dfff5
@ -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);
|
||||
|
@ -1297,8 +1297,8 @@ rm_rf (const gchar *path)
|
||||
dir = g_dir_open (path, 0, NULL);
|
||||
if (dir == NULL)
|
||||
{
|
||||
/* Assume it’s a file. */
|
||||
g_remove (path);
|
||||
/* Assume it’s a file. Ignore failure. */
|
||||
(void) g_remove (path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user