From: Richard Jones Date: Wed, 2 Jun 2010 11:31:40 +0000 (+0100) Subject: daemon: count_strings function returns size_t X-Git-Tag: 1.3.18~4 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=aee7d55fcf754d97d945c318ec06d6387ade067b;p=libguestfs.git daemon: count_strings function returns size_t --- diff --git a/daemon/daemon.h b/daemon/daemon.h index de598cd..d90b65c 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -43,7 +43,7 @@ extern int xread (int sock, void *buf, size_t len) __attribute__((__warn_unused_result__)); extern int add_string (char ***argv, int *size, int *alloc, const char *str); -extern int count_strings (char *const *argv); +extern size_t count_strings (char *const *argv); extern void sort_strings (char **argv, int len); extern void free_strings (char **argv); extern void free_stringslen (char **argv, int len); diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index c0d524a..f9e5a68 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -544,10 +544,10 @@ add_string (char ***argv, int *size, int *alloc, const char *str) return 0; } -int +size_t count_strings (char *const *argv) { - int argc; + size_t argc; for (argc = 0; argv[argc] != NULL; ++argc) ; diff --git a/daemon/parted.c b/daemon/parted.c index 9c65570..bf45f8b 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -392,7 +392,7 @@ do_part_get_bootable (const char *device, int partnum) return -1; /* We want lines[1+partnum]. */ - if (count_strings (lines) < 1+partnum) { + if (count_strings (lines) < (size_t) (1+partnum)) { reply_with_error ("partition number out of range: %d", partnum); free_strings (lines); return -1;