From 09756941d95e16e993a0833b994c1dea196cb56b Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 11 Feb 2016 14:30:20 +0100 Subject: [PATCH] cuda.c: print_reverse_list: improve error handling If some error has occurred, then the printer in the caller will be NULL, in which case isl_printer_get_file will return NULL as well. Handle this case inside print_reverse_list by not doing anything in case of a NULL FILE * input argument. Signed-off-by: Sven Verdoolaege --- cuda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda.c b/cuda.c index 3063f6d..747ef77 100644 --- a/cuda.c +++ b/cuda.c @@ -157,7 +157,7 @@ static void print_reverse_list(FILE *out, int len, int *list) { int i; - if (len == 0) + if (!out || len == 0) return; fprintf(out, "("); -- 2.11.4.GIT