aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/blackbody.c8
-rw-r--r--src/libred.h6
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*);