[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH libguestfs 12/13] xattr.c: avoid warning about comparison between signed and unsigned



From: Jim Meyering <meyering redhat com>

* daemon/xattr.c (getxattrs): Use an unsigned index.
---
 daemon/xattr.c |   10 ++++++----
 1 files 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.6.4.378.g88f2f


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]