mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
grel: Check the number of fields is 2
This is what’s documented as supported (and the only value that is supported), so might as well check for it early. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
@@ -197,6 +197,8 @@ g_relation_new (gint fields)
|
||||
GRelation* rel = g_new0 (GRelation, 1);
|
||||
size_t unsigned_fields;
|
||||
|
||||
g_return_val_if_fail (fields == 2, NULL);
|
||||
|
||||
unsigned_fields = (size_t) fields;
|
||||
|
||||
rel->fields = unsigned_fields;
|
||||
|
Reference in New Issue
Block a user