summaryrefslogtreecommitdiffstats
path: root/fish/edit.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-21 14:41:49 +0200
committerJim Meyering <meyering@redhat.com>2009-08-21 15:24:24 +0200
commitc17ff8145718ed86419a7f6c5000b73dd54e324a (patch)
tree6f3d3d683f8abada34366fe3e820d1b6ee308a89 /fish/edit.c
parent7faff93c3cd2143ee20127f75625f5c520b9d787 (diff)
downloadlibguestfs-c17ff8145718ed86419a7f6c5000b73dd54e324a.tar.gz
libguestfs-c17ff8145718ed86419a7f6c5000b73dd54e324a.tar.xz
libguestfs-c17ff8145718ed86419a7f6c5000b73dd54e324a.zip
edit.c: avoid warning about signed/unsigned comparison
* fish/edit.c (load_file): Change type of param from int to size_t. (do_edit): Adjust caller.
Diffstat (limited to 'fish/edit.c')
-rw-r--r--fish/edit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fish/edit.c b/fish/edit.c
index 3e6973e5..1b6ce23c 100644
--- a/fish/edit.c
+++ b/fish/edit.c
@@ -30,7 +30,7 @@
/* guestfish edit command, suggested by Ján Ondrej, implemented by RWMJ */
static char *
-load_file (const char *filename, int *len_r)
+load_file (const char *filename, size_t *len_r)
{
int fd, r, start;
char *content = NULL, *p;
@@ -80,7 +80,7 @@ do_edit (const char *cmd, int argc, char *argv[])
char buf[256];
const char *editor;
char *content, *content_new;
- int r, fd, size;
+ int r, fd;
if (argc != 1) {
fprintf (stderr, _("use '%s filename' to edit a file\n"), cmd);
@@ -138,6 +138,7 @@ do_edit (const char *cmd, int argc, char *argv[])
}
/* Reload it. */
+ size_t size;
content_new = load_file (filename, &size);
if (content_new == NULL) {
unlink (filename);