aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-08-10 12:01:45 +1200
committerDavid Phillips <david@sighup.nz>2017-08-10 12:01:45 +1200
commit6cfc8add274feadbe9357638ad83c207ddd39f4d (patch)
tree5be72e49ace549bb35511b9158c265476c853e55
parent01aee2c35d987f3b2eb98e7ec5957d947f7f6a66 (diff)
downloadfractal-gen-opencl-6cfc8add274feadbe9357638ad83c207ddd39f4d.tar.xz
Fix off-by-one error in cl_error bounds checking
-rw-r--r--cl_error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cl_error.c b/cl_error.c
index 293a3d8..55b91bd 100644
--- a/cl_error.c
+++ b/cl_error.c
@@ -77,7 +77,7 @@ static const char *cl_error_strings[] = {
const char *get_cl_error_string(cl_int error)
{
error = -error;
- if (error < 0 || error > sizeof(cl_error_strings) / sizeof(const char *))
+ if (error < 0 || error >= sizeof(cl_error_strings) / sizeof(const char *))
return "Error value out of bounds";
return cl_error_strings[error];