From 2ccba45d301997042e9b3ba07bd157d02b7e7b94 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2014 11:10:11 +0100 Subject: s3-clitar: Improve readabilty of tar_read_inclusion_file(). Signed-off-by: Andreas Schneider Reviewed-by: David Disseldorp --- source3/client/clitar.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 45b88ea102a..fa16c9b382c 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1235,15 +1235,18 @@ static int tar_read_inclusion_file (struct tar *t, const char* filename) char *line; TALLOC_CTX *ctx = PANIC_IF_NULL(talloc_new(NULL)); int err = 0; - int fd = open(filename, O_RDONLY); + int fd; + fd = open(filename, O_RDONLY); if (fd < 0) { DBG(0, ("Can't open inclusion file '%s': %s\n", filename, strerror(errno))); err = 1; goto out; } - while ((line = afdgets(fd, ctx, 0))) { + for (line = afdgets(fd, ctx, 0); + line != NULL; + line = afdgets(fd, ctx, 0)) { tar_add_selection_path(t, line); } -- cgit v1.2.1