--- ray/src/common/tonemap.c 1997/12/01 09:52:00 3.7 +++ ray/src/common/tonemap.c 1998/08/17 17:58:47 3.8 @@ -1,7 +1,7 @@ -/* Copyright (c) 1997 Regents of the University of California */ +/* Copyright (c) 1998 Silicon Graphics, Inc. */ #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static char SCCSid[] = "$SunId$ SGI"; #endif /* @@ -186,7 +186,7 @@ int len; if (tmTop == NULL) returnErr(TM_E_TMINVAL); - if (ls == NULL | scan == NULL | len <= 0) + if (ls == NULL | scan == NULL | len < 0) returnErr(TM_E_ILLEGAL); for (i = len; i--; ) { if (tmNeedMatrix(tmTop)) /* get monitor RGB */ @@ -257,10 +257,12 @@ int wt; int oldorig, oldlen, horig, hlen; register int i, j; - if (len <= 0) - returnErr(TM_E_ILLEGAL); if (tmTop == NULL) returnErr(TM_E_TMINVAL); + if (len < 0) + returnErr(TM_E_ILLEGAL); + if (len == 0) + returnOK; /* first, grow limits */ if (tmTop->histo == NULL) { for (i = len; i-- && ls[i] < MINBRT; ) @@ -448,7 +450,7 @@ int len; if (tmTop == NULL || tmTop->lumap == NULL) returnErr(TM_E_TMINVAL); - if (ps == NULL | ls == NULL | len <= 0) + if (ps == NULL | ls == NULL | len < 0) returnErr(TM_E_ILLEGAL); while (len--) { if ((li = *ls++) < tmTop->mbrmin)