aboutsummaryrefslogtreecommitdiffstats
path: root/src/blackbody.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2016-01-05 17:24:39 +0100
committerMattias Andrée <maandree@member.fsf.org>2016-01-05 17:24:39 +0100
commit091f3ea64076bb3318301fe3fef549bb49b0a14c (patch)
treeebc0a5f4182f19d6ff9df03bbdcac76027a2eaf5 /src/blackbody.c
parentadd libred_term_colour.3 (diff)
downloadlibred-091f3ea64076bb3318301fe3fef549bb49b0a14c.tar.gz
libred-091f3ea64076bb3318301fe3fef549bb49b0a14c.tar.bz2
libred-091f3ea64076bb3318301fe3fef549bb49b0a14c.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src/blackbody.c')
-rw-r--r--src/blackbody.c8
1 files changed, 4 insertions, 4 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)