From: W. Trevor King Date: Tue, 26 Oct 2010 14:15:21 +0000 (-0400) Subject: Don't print more elements than there are in src/sorting/main.c:printlist. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=903aa21746e4fc5a5c78ff02ecea47404bee51c5;p=parallel_computing.git Don't print more elements than there are in src/sorting/main.c:printlist. --- diff --git a/src/sorting/main.c b/src/sorting/main.c index d8c3e35..6246384 100644 --- a/src/sorting/main.c +++ b/src/sorting/main.c @@ -17,6 +17,8 @@ void printlist(FILE * stream, int list_size, double *list, int num_shown) { int i; if (num_shown > 0) { + if (num_shown > list_size/2) + num_shown = list_size/2; for (i = 0; i < num_shown; i++) fprintf(stream, "%g\t", list[i]); fprintf(stream, "...\n...\t");