From c36fa40b981401cdbf61f596b804e79283d658b2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 17 Aug 2009 10:30:52 +0200 Subject: [PATCH] xattr.c: avoid warning about comparison between signed and unsigned * daemon/xattr.c (getxattrs): Use an unsigned index. --- daemon/xattr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/daemon/xattr.c b/daemon/xattr.c index 17d9382..1531070 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -195,11 +195,13 @@ getxattrs (const char *path, error: free (buf); if (r) { - if (r->guestfs_int_xattr_list_val) - for (i = 0; i < r->guestfs_int_xattr_list_len; ++i) { - free (r->guestfs_int_xattr_list_val[i].attrname); - free (r->guestfs_int_xattr_list_val[i].attrval.attrval_val); + if (r->guestfs_int_xattr_list_val) { + unsigned int k; + for (k = 0; k < r->guestfs_int_xattr_list_len; ++k) { + free (r->guestfs_int_xattr_list_val[k].attrname); + free (r->guestfs_int_xattr_list_val[k].attrval.attrval_val); } + } free (r->guestfs_int_xattr_list_val); } free (r); -- 1.8.3.1