From 091f3ea64076bb3318301fe3fef549bb49b0a14c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 5 Jan 2016 17:24:39 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blackbody.c | 8 ++++---- src/libred.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/blackbody.c b/src/blackbody.c index 0368156..a46b5a6 100644 --- a/src/blackbody.c +++ b/src/blackbody.c @@ -136,9 +136,9 @@ static void interpolate(double x1, double y1, double x2, double y2, double temp, * @param b Output parameter for the blue value. * @return 0 on succeess, -1 on error. * - * @throws 0 The file did not have the expected size. - * @throws EDOM The selected temperature is below 1000 K. - * @throws Any error specified for pread(3). + * @throws EOVERFLOW The file did not have the expected size. + * @throws EDOM The selected temperature is below 1000 K. + * @throws Any error specified for pread(3). */ int libred_get_colour(long int temp, double* r, double* g, double* b) { @@ -156,7 +156,7 @@ int libred_get_colour(long int temp, double* r, double* g, double* b) /* Read table. */ offset = ((off_t)temp - LIBRED_LOWEST_TEMPERATURE) / LIBRED_DELTA_TEMPERATURE; offset *= (off_t)(sizeof(values) / 2); - errno = 0; xpread(libred_fd, values, sizeof(values), offset); + errno = EOVERFLOW; xpread(libred_fd, values, sizeof(values), offset); /* Get colour. */ if (temp % LIBRED_DELTA_TEMPERATURE) diff --git a/src/libred.h b/src/libred.h index f7e5a5f..27b809d 100644 --- a/src/libred.h +++ b/src/libred.h @@ -160,9 +160,9 @@ void libred_term_colour(void); * @param b Output parameter for the blue value. * @return 0 on succeess, -1 on error. * - * @throws 0 The file did not have the expected size. - * @throws EDOM The selected temperature is below 1000 K. - * @throws Any error specified for pread(3). + * @throws EOVERFLOW The file did not have the expected size. + * @throws EDOM The selected temperature is below 1000 K. + * @throws Any error specified for pread(3). */ int libred_get_colour(long int, double*, double*, double*); -- cgit v1.2.3-70-g09d2