ソースを参照

Checking a FILE pointer against NULL.

[scan-build] NULL stream pointer.
Cyril Roelandt 13 年 前
コミット
c9efa6da78
共有1 個のファイルを変更した1 個の追加0 個の削除を含む
  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);