diff --git a/lib/src/Utils/File.c b/lib/src/Utils/File.c index 5cf80d1f..a806da4a 100644 --- a/lib/src/Utils/File.c +++ b/lib/src/Utils/File.c @@ -248,7 +248,7 @@ cl_int cl_util_write_binaries(const cl_program program, // write the binary to the output file FILE *f = NULL; - if (fopen_s(&f, filename, "wb") != 0) + if (fopen_s(&f, filename, "wb") == 0) { if (fwrite(binaries_ptr[i], sizeof(unsigned char), binaries_size[i], f)