diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2016-01-04 13:44:05 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2016-01-04 13:44:05 +0100 |
commit | 63a9747b2e84227e9cdea655ea2ed6891f3eb4ef (patch) | |
tree | e6487b3da87aafbd1ae0d779acae8498764b192c /src/haiku.c | |
parent | whitespace (diff) | |
download | radharc-63a9747b2e84227e9cdea655ea2ed6891f3eb4ef.tar.gz radharc-63a9747b2e84227e9cdea655ea2ed6891f3eb4ef.tar.bz2 radharc-63a9747b2e84227e9cdea655ea2ed6891f3eb4ef.tar.xz |
fix errors
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src/haiku.c')
-rw-r--r-- | src/haiku.c | 9 |
1 files changed, 4 insertions, 5 deletions
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; } |