소스 검색

Do not compare a pointer to the integer value "0".

[Coccinelle] Zero-testing a pointer-typed value.
http://coccinelle.lip6.fr/rules/badzero.cocci
Cyril Roelandt 13 년 전
부모
커밋
bc650b3ddb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/drivers/opencl/driver_opencl_utils.c

+ 1 - 1
src/drivers/opencl/driver_opencl_utils.c

@@ -137,7 +137,7 @@ char *_starpu_opencl_load_program_source(const char *filename)
         char        c;
 
         fh = fopen(filename, "r");
-        if (fh == 0)
+        if (!fh)
                 return NULL;
 
         stat(filename, &statbuf);