src/lib/snof.c 1.5

1.5 2009/09/23 18:42:29 angie
Fixed compiler warnings from gcc 4.3.3, mostly about system calls whose return values weren't checked and non-literal format strings with no args.
Index: src/lib/snof.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/snof.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -B -U 4 -r1.4 -r1.5
--- src/lib/snof.c	6 May 2003 07:33:44 -0000	1.4
+++ src/lib/snof.c	23 Sep 2009 18:42:29 -0000	1.5
@@ -278,9 +278,10 @@
  * later calls to snof system. Strdup if you want to keep it.)
  */
 {
 fseek(snof->file, snof->headSize + ix*snof->itemSize, SEEK_SET);
-fread(snof->mid, snof->itemSize, 1, snof->file);
+if (fread(snof->mid, snof->itemSize, 1, snof->file) != 1 && ferror(snof->file))
+    errAbort("snofNameAtIx: fread failed: %s", strerror(ferror(snof->file)));
 return snof->mid;
 }
 
 void snofNameOffsetAtIx(struct snof *snof, int ix, char **pName, long *pOffset)