-
- oct->len = oct->size = status.st_size;
- oct->buf = (unsigned char *) odr_malloc (out, oct->size);
- fread (oct->buf, 1, oct->size, inf);
- fclose (inf);
-
+
+ oct->len = status.st_size;
+ oct->buf = (char *) odr_malloc (out, oct->len);
+ if (fread(oct->buf, 1, oct->len, inf) != (size_t) oct->len)
+ {
+ printf("Incomplete read of file %s\n", fname);
+ }
+ if (fclose(inf))
+ {
+ printf("Close failed for file %s\n", fname);
+ }
+