diff options
author | Simon McVittie <smcv@collabora.com> | 2022-04-24 11:06:51 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2022-04-24 11:06:51 +0100 |
commit | 4c51a54c36eb1a9d728acb14a700271adc7e0ee4 (patch) | |
tree | f56bc1c0dfc9445d94acbebfb0996a9f31971d9c /tests/test-libglnx-xattrs.c | |
parent | f65b05f2d540e8560fde374c206f872e24436e32 (diff) | |
download | libglnx-4c51a54c36eb1a9d728acb14a700271adc7e0ee4.tar.gz |
tests: Make iterator signedness agree with limit
g_variant_n_children() returns a size_t (or gsize, which is equivalent)
so in principle it could overflow an int, although in practice we are
not going to have that many extended attributes. This silences a
warning from gcc -Wsign-compare.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'tests/test-libglnx-xattrs.c')
-rw-r--r-- | tests/test-libglnx-xattrs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-libglnx-xattrs.c b/tests/test-libglnx-xattrs.c index b72b0d0..ad52b76 100644 --- a/tests/test-libglnx-xattrs.c +++ b/tests/test-libglnx-xattrs.c @@ -122,7 +122,7 @@ do_write_run (GLnxDirFdIterator *dfd_iter, GError **error) if (!glnx_fd_get_all_xattrs (fd, ¤t_xattrs, NULL, error)) return FALSE; - for (int i = 0; i < g_variant_n_children (current_xattrs); i++) + for (size_t i = 0; i < g_variant_n_children (current_xattrs); i++) { const char *name, *value; g_variant_get_child (current_xattrs, i, "(^&ay^&ay)", &name, &value); |