Explorar o código

Checking a FILE pointer against NULL.

[scan-build] NULL stream pointer.
Cyril Roelandt %!s(int64=14) %!d(string=hai) anos
pai
achega
c9efa6da78
Modificáronse 1 ficheiros con 1 adicións e 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);