From 724bafe4f5f6adf71d401e763adb7ab74a1c1b5f Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Mon, 30 Jan 2012 22:27:16 +0100 Subject: [PATCH] stop program if invalid array size occurs --- prefix/hillis_sum.c | 1 + 1 file changed, 1 insertion(+) diff --git a/prefix/hillis_sum.c b/prefix/hillis_sum.c index d575fba..4871c60 100644 --- a/prefix/hillis_sum.c +++ b/prefix/hillis_sum.c @@ -25,6 +25,7 @@ void algorithm (numtype x[], unsigned long size, unsigned int ops[]) { if (is_power_of_two(size) != 1) { fprintf(stderr, "Hillis-Sum algorithm only works on arrays on size 2^n\n"); + exit(1); } for(k=2; k <= size; k <<=1){ -- 2.43.0