aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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. */