diff --git a/daemon/lvm-filter.c b/daemon/lvm-filter.c index 56abc49e3..ed10a489c 100644 --- a/daemon/lvm-filter.c +++ b/daemon/lvm-filter.c @@ -155,8 +155,8 @@ set_filter (const char *filter) } CLEANUP_FREE char *line = NULL; - size_t len = 0; - while (getline (&line, &len, ifp) != -1) { + size_t allocsize = 0; + while (getline (&line, &allocsize, ifp) != -1) { int r; if (is_filter_line (line)) { r = fprintf (ofp, " filter = [ %s ]\n", filter); diff --git a/daemon/md.c b/daemon/md.c index cda18874d..b302a8cbc 100644 --- a/daemon/md.c +++ b/daemon/md.c @@ -442,7 +442,7 @@ do_md_stat (const char *md) size_t mdlen; FILE *fp; CLEANUP_FREE char *line = NULL; - size_t len = 0; + size_t allocsize = 0; ssize_t n; guestfs_int_mdstat_list *ret = NULL; @@ -457,7 +457,7 @@ do_md_stat (const char *md) } /* Search for a line which begins with " : ". */ - while ((n = getline (&line, &len, fp)) != -1) { + while ((n = getline (&line, &allocsize, fp)) != -1) { if (STRPREFIX (line, md) && line[mdlen] == ' ' && line[mdlen+1] == ':' && line[mdlen+2] == ' ') { /* Found it. */ diff --git a/examples/libvirt_auth.c b/examples/libvirt_auth.c index f0b8bbb74..3d315c3b4 100644 --- a/examples/libvirt_auth.c +++ b/examples/libvirt_auth.c @@ -104,7 +104,7 @@ auth_callback (guestfs_h *g, size_t i; char *prompt; char *reply = NULL; - size_t replylen; + size_t allocsize; char *pass; ssize_t len; int r; @@ -129,7 +129,7 @@ auth_callback (guestfs_h *g, printf ("%s: ", prompt); free (prompt); - len = getline (&reply, &replylen, stdin); + len = getline (&reply, &allocsize, stdin); if (len == -1) { perror ("getline"); exit (EXIT_FAILURE); diff --git a/fish/fish.c b/fish/fish.c index 43581004b..27a9d9645 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -972,7 +972,7 @@ execute_and_inline (const char *cmd, int global_exit_on_error) { FILE *pp; CLEANUP_FREE char *line = NULL; - size_t len = 0; + size_t allocsize = 0; ssize_t n; int exit_on_error; struct parsed_command pcmd; @@ -983,7 +983,7 @@ execute_and_inline (const char *cmd, int global_exit_on_error) return -1; } - while ((n = getline (&line, &len, pp)) != -1) { + while ((n = getline (&line, &allocsize, pp)) != -1) { exit_on_error = global_exit_on_error; /* Chomp final line ending which parse_command_line would not expect. */ diff --git a/fish/keys.c b/fish/keys.c index 8db937ffc..4749cfc88 100644 --- a/fish/keys.c +++ b/fish/keys.c @@ -41,7 +41,7 @@ read_key (const char *param) char *ret = NULL; int tty; int tcset = 0; - size_t n = 0; + size_t allocsize = 0; ssize_t len; /* Read and write to /dev/tty if available. */ @@ -69,7 +69,7 @@ read_key (const char *param) } } - len = getline (&ret, &n, infp); + len = getline (&ret, &allocsize, infp); if (len == -1) { perror ("getline"); ret = NULL; diff --git a/tests/mount-local/test-parallel-mount-local.c b/tests/mount-local/test-parallel-mount-local.c index abfbb82f6..fb82b5f23 100644 --- a/tests/mount-local/test-parallel-mount-local.c +++ b/tests/mount-local/test-parallel-mount-local.c @@ -466,13 +466,13 @@ read_line_from (const char *cmd) { FILE *pp; char *ret = NULL; - size_t n; + size_t allocsize; pp = popen (cmd, "r"); if (pp == NULL) error (EXIT_FAILURE, errno, "%s: external command failed", cmd); - if (getline (&ret, &n, pp) == -1) + if (getline (&ret, &allocsize, pp) == -1) error (EXIT_FAILURE, errno, "could not read line from external command"); if (pclose (pp) == -1)