aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2016-01-02 08:10:56 +0100
committerMattias Andrée <maandree@member.fsf.org>2016-01-02 08:10:56 +0100
commit656279f5601c7d1fc9ff572000cd6b706bb46b7f (patch)
treeb9596a665602c24b4c029a81f912649421040830
parentm fix (diff)
downloadradharc-656279f5601c7d1fc9ff572000cd6b706bb46b7f.tar.gz
radharc-656279f5601c7d1fc9ff572000cd6b706bb46b7f.tar.bz2
radharc-656279f5601c7d1fc9ff572000cd6b706bb46b7f.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/blackbody.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blackbody.c b/src/blackbody.c
index 8bb5873..1e06fb9 100644
--- a/src/blackbody.c
+++ b/src/blackbody.c
@@ -125,13 +125,13 @@ get_colour(int fd, int temp, double *r, double *g, double *b)
* unencodeable. */
if (temp > HIGHEST) temp = HIGHEST;
/* Things do not glow below 1000 K. Yes, fire is hot! */
- if (temp < LOWEST) return EDOM, -1;
+ if (temp < LOWEST) return errno = EDOM, -1;
/* Read table. */
offset = ((off_t)temp - LOWEST) / DELTA;
offset *= (off_t)(5 * sizeof(double));
errno = 0;
- if (pread(fd, values, sizeof(values), offset) < sizeof(values))
+ if (pread(fd, values, sizeof(values), offset) < (ssize_t)sizeof(values))
return -1;
/* Get colour. */