aboutsummaryrefslogtreecommitdiffstats
path: root/src/haiku.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2016-01-04 13:44:05 +0100
committerMattias Andrée <maandree@member.fsf.org>2016-01-04 13:44:05 +0100
commit63a9747b2e84227e9cdea655ea2ed6891f3eb4ef (patch)
treee6487b3da87aafbd1ae0d779acae8498764b192c /src/haiku.c
parentwhitespace (diff)
downloadradharc-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.c9
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;
}