From 63a9747b2e84227e9cdea655ea2ed6891f3eb4ef Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 4 Jan 2016 13:44:05 +0100 Subject: fix errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/haiku.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/haiku.c') diff --git a/src/haiku.c b/src/haiku.c index 5c9e5c7..25387f4 100644 --- a/src/haiku.c +++ b/src/haiku.c @@ -51,16 +51,15 @@ static const char * random_haiku(const char *str, ... /*, NULL */) { int n = 1; - const char *s; + const char *s = str; va_list args; va_start(args, str); - while (va_arg(args, const char *)) n++; + while (va_arg(args, const char *)) n++; va_end(args); - if (n == 1) return str; + if (n == 1) return str; n = random_int(n); - if (!n) return str; va_start(args, str); - while (n--) s = va_arg(args, const char *); + while (n--) s = va_arg(args, const char *); va_end(args); return s; } -- cgit v1.2.3-70-g09d2