- fread(xmlstr, sz, 1, f);
- fclose(f);
+ if (fread(xmlstr, sz, 1, f) != 1)
+ {
+ fprintf(stderr, "%s: read failed for file %s\n", prog, xmlfile);
+ exit(1);
+ }
+ if (fclose(f))
+ {
+ fprintf(stderr, "%s: close failed for file %s\n", prog, xmlfile);
+ exit(1);
+ }