*/
#include <stdio.h>
+#include "errors.h"
#include "mtypes.h"
#include "attrib.h"
#include "enums.h"
fprintf(f,"255\n");
fclose(f);
f = fopen( filename, "ab" ); /* reopen in binary append mode */
+ if (!f) {
+ fprintf(stderr, "Error while reopening %s in write_ppm()\n",
+ filename);
+ return;
+ }
for (y=0; y < height; y++) {
for (x = 0; x < width; x++) {
int yy = invert ? (height - 1 - y) : y;