src/hg/protein/pfamXref/pfamXref.c 1.9

1.9 2009/09/23 18:42:25 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/hg/protein/pfamXref/pfamXref.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/protein/pfamXref/pfamXref.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -b -B -U 4 -r1.8 -r1.9
--- src/hg/protein/pfamXref/pfamXref.c	3 Sep 2008 19:21:01 -0000	1.8
+++ src/hg/protein/pfamXref/pfamXref.c	23 Sep 2009 18:42:25 -0000	1.9
@@ -58,9 +58,9 @@
 while (!done)
     {
     /* get to the beginning of a Pfam record */
     idFound = 0;
-    while (fgets(line, 1000, inf) != NULL)
+    while (fgets(line, sizeof(line), inf) != NULL)
     	{
     	chp = strstr(line, "GF ID");
     	if (chp != NULL)
 		{
@@ -75,18 +75,18 @@
     pfamID = strdup(chp);
     
     /* Get Pfam AC */
 
-    fgets(line, 1000, inf);
+    mustGetLine(inf, line, sizeof(line));
     chp = strstr(line, "GF AC   ");
     chp = chp + 8;
     *(chp + strlen(chp) - 1) = '\0'; // remove LF
     chp1 = strstr(chp, ".");
     if (chp1 != NULL) *chp1 = '\0';
     pfamAC = strdup(chp);
     
     /* Get Pfam description.  Please note, Pfam-B does not have this field.*/
-    fgets(line, 1000, inf);
+    mustGetLine(inf, line, sizeof(line));
     chp = strstr(line, "GF DE   ");
     chp = chp + 8;
     *(chp + strlen(chp) - 1) = '\0'; // remove LF
     desc = chp;
@@ -98,9 +98,9 @@
     gsDone  = 0;
     gsFound = 0;
     while (!gsDone)
 	{
-	fgets(line, 1000, inf);
+	mustGetLine(inf, line, sizeof(line));
     	chp = strstr(line, "#=GS ");
     	if (chp != NULL)
 	    {
 	    chp = strstr(chp, " AC ");
@@ -150,10 +150,10 @@
 carefulClose(&o1);
 carefulClose(&o2);
 
 sprintf(cond_str, "cat jj.dat | sort | uniq >%s",outputFileName2);
-system(cond_str);
-system("rm jj.dat");
+mustSystem(cond_str);
+mustSystem("rm jj.dat");
 
 return(0);
 }