int radian;
char line[3 * W];
- FILE *fichier;
+ FILE *input_file;
- fichier = fopen(filename, "rb");
- if (!fichier) {
+ input_file = fopen(filename, "rb");
+ if (!input_file) {
perror(filename);
return 1;
}
- fread(line, 1, 15, fichier);
+ if (fread(line, 1, 15, input_file) != 15)
+ return 1;
for (i = 0; i < H; i++) {
- fread(line, 1, 3 * W, fichier);
+ if (fread(line, 1, 3 * W, input_file) != 3 * W)
+ return 1;
for (j = 0; j < W; j++) {
tab_r[W * i + j] = line[3 * j ];
tab_g[W * i + j] = line[3 * j + 1];
tab_b[W * i + j] = line[3 * j + 2];
}
}
- fclose(fichier);
+ fclose(input_file);
/* tables sin/cos */
for (i = 0; i < 360; i++) {
if (argc != 3) {
printf("usage: %s directory/ image.pnm\n"
"generate a test video stream\n", argv[0]);
- exit(1);
+ return 1;
}
w = DEFAULT_WIDTH;