21a6584e8ecdbba6d802ab30f3ec564c08b7dcc3
galt
  Sat Jun 29 02:11:16 2013 -0700
fixing callers of sqlGetField to use sqlSafeFrag
diff --git src/hg/hgc/virusClick.c src/hg/hgc/virusClick.c
index 129de87..55f15eb 100644
--- src/hg/hgc/virusClick.c
+++ src/hg/hgc/virusClick.c
@@ -260,31 +260,31 @@
 if (getH1n1Model(gene, modelPdbUrl))
     {
     struct tempName imageFile, chimeraScript, chimerax;
     mkH1n1StructData(gene, NULL, aaSeqId, &imageFile, &chimeraScript);
     mkChimerax(gene, modelPdbUrl, chimeraScript.forCgi, &chimerax);
     printf("<A HREF=\"%s\" TARGET=_blank>%s</A>, view with <A HREF=\"%s\">Chimera</A><BR>\n", modelPdbUrl, gene, chimerax.forHtml);
     printf("<TABLE>\n");
     printf("<TR>\n");
     printf("<TD ALIGN=\"center\"><img src=\"%s\"></TD>", imageFile.forHtml);
     printf("</TR>\n");
     printf("</TABLE>\n");
     }
 return;
 
 gotPDBFile = 0;
-safef(cond_str, sizeof(cond_str), "proteinID='%s' and evalue <1.0e-5;", item);
+sqlSafefFrag(cond_str, sizeof(cond_str), "proteinID='%s' and evalue <1.0e-5;", item);
 
 printf("<TABLE>\n");
 printf("<TR><TD ALIGN=\"center\">Front</TD>\n");
 printf("<TD ALIGN=\"center\">Top</TD>\n");
 printf("<TD ALIGN=\"center\">Side</TD>\n");
 printf("</TR>\n");
 printf("<TR>\n");
 printf("<TD ALIGN=\"center\"><img src=\"%s/%s/%s.undertaker-align.view1_200.jpg\"></TD>", getH1n1StructUrl(), item, item);
 printf("<TD ALIGN=\"center\"><img src=\"%s/%s/%s.undertaker-align.view2_200.jpg\"></TD>", getH1n1StructUrl(), item, item);
 printf("<TD ALIGN=\"center\"><img src=\"%s/%s/%s.undertaker-align.view3_200.jpg\"></TD>", getH1n1StructUrl(), item, item);
 printf("</TR>\n");
 printf("<TR>\n");
 printf("<TD ALIGN=\"center\"><A HREF=\"%s/%s/%s.undertaker-align.view1_500.jpg\">500x500</A></TD>",
 	getH1n1StructUrl(), item, item);
 printf("<TD ALIGN=\"center\"><A HREF=\"%s/%s/%s.undertaker-align.view2_500.jpg\">500x500</A></TD>",
@@ -292,31 +292,31 @@
 printf("<TD ALIGN=\"center\"><A HREF=\"%s/%s/%s.undertaker-align.view3_500.jpg\">500x500</A></TD>",
 	getH1n1StructUrl(), item, item);
 printf("</TR>\n");
 printf("</TABLE>\n");
 
 printf("<BR><B>Detailed results of SAM-T02:</B> ");
 printf("<A HREF=\"%s/%s/summary.html", getH1n1StructUrl(), item);
 printf("\" TARGET=_blank>%s</A><BR>\n", item);
 
 /* by pass the following additional processing for now, until two necessary tables are built */
 hFreeConn(&conn2);
 return;
 
 if (sqlGetField(database, "protHomolog", "proteinID", cond_str) != NULL)
     {
-    safef(cond_str, sizeof(cond_str), "proteinID='%s'", item);
+    sqlSafefFrag(cond_str, sizeof(cond_str), "proteinID='%s'", item);
     predFN = sqlGetField(database, "protPredFile", "predFileName", cond_str);
     if (predFN != NULL)
 	{
 	printf("<A HREF=\"../SARS/%s/", item);
 	/* printf("%s.t2k.undertaker-align.pdb\">%s</A><BR>\n", item,item); */
 	printf("%s\">%s</A><BR>\n", predFN,item);
 	gotPDBFile = 1;
 	}
     }
 if (!gotPDBFile)
     {
     printf("No high confidence level structure prediction available for this sequence.");
     printf("<BR>\n");
     }
 printf("<B>3D Structure of Close Homologs:</B> ");
@@ -405,31 +405,31 @@
 printf("\" TARGET=_blank>%s</A><BR>\n", item);
 
 printf("<B>Secondary Structure Predictions:</B> ");
 printf("<A HREF=\"%s/%s/summary.html#secondary-structure", getH1n1StructUrl(), item);
 printf("\" TARGET=_blank>%s</A><BR>\n", item);
 
 printf("<B>3D Structure Prediction (PDB file):</B> ");
 char pdbUrl[PATH_LEN];
 safef(pdbUrl, sizeof(pdbUrl), "%s/%s/decoys/%s.try1-opt3.pdb.gz", getH1n1StructUrl(), item, item);
 struct tempName chimerax;
 mkChimerax(item, pdbUrl, NULL, &chimerax);
 
 printf("<A HREF=\"%s\" TARGET=_blank>%s</A>, view with <A HREF=\"%s\">Chimera</A><BR>\n", pdbUrl, item, chimerax.forHtml);
 
 gotPDBFile = 0;
-safef(cond_str, sizeof(cond_str), "proteinID='%s' and evalue <1.0e-5;", item);
+sqlSafefFrag(cond_str, sizeof(cond_str), "proteinID='%s' and evalue <1.0e-5;", item);
 
 printf("<TABLE>\n");
 printf("<TR><TD ALIGN=\"center\">Front</TD>\n");
 printf("<TD ALIGN=\"center\">Top</TD>\n");
 printf("<TD ALIGN=\"center\">Side</TD>\n");
 printf("</TR>\n");
 printf("<TR>\n");
 printf("<TD ALIGN=\"center\"><img src=\"%s/%s/%s.undertaker-align.view1_200.jpg\"></TD>", getH1n1StructUrl(), item, item);
 printf("<TD ALIGN=\"center\"><img src=\"%s/%s/%s.undertaker-align.view2_200.jpg\"></TD>", getH1n1StructUrl(), item, item);
 printf("<TD ALIGN=\"center\"><img src=\"%s/%s/%s.undertaker-align.view3_200.jpg\"></TD>", getH1n1StructUrl(), item, item);
 printf("</TR>\n");
 printf("<TR>\n");
 printf("<TD ALIGN=\"center\"><A HREF=\"%s/%s/%s.undertaker-align.view1_500.jpg\">500x500</A></TD>",
 	getH1n1StructUrl(), item, item);
 printf("<TD ALIGN=\"center\"><A HREF=\"%s/%s/%s.undertaker-align.view2_500.jpg\">500x500</A></TD>",
@@ -437,31 +437,31 @@
 printf("<TD ALIGN=\"center\"><A HREF=\"%s/%s/%s.undertaker-align.view3_500.jpg\">500x500</A></TD>",
 	getH1n1StructUrl(), item, item);
 printf("</TR>\n");
 printf("</TABLE>\n");
 
 printf("<BR><B>Detailed results of SAM-T02:</B> ");
 printf("<A HREF=\"%s/%s/summary.html", getH1n1StructUrl(), item);
 printf("\" TARGET=_blank>%s</A><BR>\n", item);
 
 /* by pass the following additional processing for now, until two necessary tables are built */
 hFreeConn(&conn2);
 return;
 
 if (sqlGetField(database, "protHomolog", "proteinID", cond_str) != NULL)
     {
-    safef(cond_str, sizeof(cond_str), "proteinID='%s'", item);
+    sqlSafefFrag(cond_str, sizeof(cond_str), "proteinID='%s'", item);
     predFN = sqlGetField(database, "protPredFile", "predFileName", cond_str);
     if (predFN != NULL)
 	{
 	printf("<A HREF=\"../SARS/%s/", item);
 	/* printf("%s.t2k.undertaker-align.pdb\">%s</A><BR>\n", item,item); */
 	printf("%s\">%s</A><BR>\n", predFN,item);
 	gotPDBFile = 1;
 	}
     }
 if (!gotPDBFile)
     {
     printf("No high confidence level structure prediction available for this sequence.");
     printf("<BR>\n");
     }
 printf("<B>3D Structure of Close Homologs:</B> ");