summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2019-06-21 09:58:15 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2019-06-21 10:04:49 -0500
commit16fb81cd7e3a3586252fc5d185e5c2c95125d045 (patch)
tree80c5ad8bbcb304434e07c5b170676dacce2da8ad
parentd12c5aaba8f2f6208c3493b42ab15a139c049d58 (diff)
downloadgvdb-16fb81cd7e3a3586252fc5d185e5c2c95125d045.tar.gz
Add some g_return checks to gvdb_table_write_contents()
I'm not auditing all the public functions in this file for precondition checks, but since I'm adding an async version of this function, it makes sense to ensure there are matching checks for the sync version.
-rw-r--r--gvdb-builder.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gvdb-builder.c b/gvdb-builder.c
index 55b4513..ff28edf 100644
--- a/gvdb-builder.c
+++ b/gvdb-builder.c
@@ -511,6 +511,10 @@ gvdb_table_write_contents (GHashTable *table,
FileBuilder *fb;
GString *str;
+ g_return_val_if_fail (table != NULL, FALSE);
+ g_return_val_if_fail (filename != NULL, FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
fb = file_builder_new (byteswap);
file_builder_add_hash (fb, table, &root);
str = file_builder_serialise (fb, root);