Explorar el Código

Checking a FILE pointer against NULL.

[scan-build] NULL stream pointer.
Cyril Roelandt hace 13 años
padre
commit
c9efa6da78
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      examples/ppm_downscaler/ppm_downscaler.c

+ 1 - 0
examples/ppm_downscaler/ppm_downscaler.c

@@ -53,6 +53,7 @@ struct ppm_image *file_to_ppm(char *filename)
 	assert(ppm);
 	
 	FILE *file = fopen(filename, "r");
+	assert(file);
 
 	/* read the file's dimensions */
 	ret = fscanf(file, "P6\n%d %d\n%d\n", &ppm->ncols, &ppm->nlines, &ppm->coldepth);