[gtk+] inspector: Check a return value
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Check a return value
- Date: Fri, 17 Jul 2015 20:13:39 +0000 (UTC)
commit 1b8d06da2d3f9c5615b2e367335e780c3bbb2947
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jul 17 15:56:34 2015 -0400
inspector: Check a return value
We don't care about the error here, but we were relying on
g_resources_get_info to zero the size even in case of error.
No need to do that, we can just check the return value. Plus,
it makes coverity happy.
gtk/inspector/resource-list.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/inspector/resource-list.c b/gtk/inspector/resource-list.c
index 32a19d4..16e9651 100644
--- a/gtk/inspector/resource-list.c
+++ b/gtk/inspector/resource-list.c
@@ -120,9 +120,11 @@ load_resources_recurse (GtkInspectorResourceList *sl,
else
{
count = 0;
- g_resources_get_info (p, 0, &size, NULL, NULL);
- *count_out += 1;
- *size_out += size;
+ if (g_resources_get_info (p, 0, &size, NULL, NULL))
+ {
+ *count_out += 1;
+ *size_out += size;
+ }
}
stored_size = size;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]