aboutsummaryrefslogtreecommitdiffstats
path: root/src/haiku.c
diff options
context:
space:
mode:
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;
}