From 84779e0fc5d1297c95c86d68c16e262d20da7480 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 9 May 2006 22:36:56 +0200 Subject: Merge two if's --- simpletail.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'simpletail.c') diff --git a/simpletail.c b/simpletail.c index fa47668..ec00b19 100644 --- a/simpletail.c +++ b/simpletail.c @@ -90,15 +90,15 @@ static off_t lines(int fd, int file_size, unsigned int n_lines) dprintf(" Found \\n at position %d\n", i); n_lines--; - if (n_lines == 0) + if (n_lines == 0) { + /* We don't want the first \n */ + offset += i + 1; break; + } } } } - if (n_lines == 0) - offset += i + 1; /* We don't want the first \n */ - return offset; } -- cgit v1.2.3-54-g00ecf