From 903aa21746e4fc5a5c78ff02ecea47404bee51c5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 26 Oct 2010 10:15:21 -0400 Subject: [PATCH] Don't print more elements than there are in src/sorting/main.c:printlist. --- src/sorting/main.c | 2 ++ 1 file changed, 2 insertions(+) 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"); -- 2.26.2