dos3d
diff src/palman.c @ 8:569d62294ae3
minor
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 21 Nov 2011 12:45:18 +0200 |
parents | 7f12c7d084d5 |
children |
line diff
1.1 --- a/src/palman.c Mon Nov 21 12:12:23 2011 +0200 1.2 +++ b/src/palman.c Mon Nov 21 12:45:18 2011 +0200 1.3 @@ -61,10 +61,14 @@ 1.4 { 1.5 int i, j; 1.6 1.7 + if(!ncol) { 1.8 + return -1; 1.9 + } 1.10 + 1.11 /* gradient range for each color */ 1.12 range = MAX_COLORS / ncol; 1.13 1.14 - if(range == 1) { 1.15 + if(range <= 1) { 1.16 memcpy(pal, colors, ncol * sizeof *pal); 1.17 return 0; 1.18 }