9f06a7e9627b6d1b42edb4ef3a555b59d3119d76
chmalee
  Wed Aug 28 08:55:53 2019 -0700
Change sqlQuickString to hRangeQuery for code review feedback, refs #24047

diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index ef89bc2..de048ab 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -18504,37 +18504,33 @@
 	    if (sameString("hide",
 			   cartUsualString(cart, gcTable,
 					   trackDbSettingOrDefault(gcTdb, "visibility", "hide"))))
 		printf("&%s=dense", gcTable);
 	    printf("\">%s SNP</A> </B></TD></TR>\n", gcTdb->shortLabel);
 	    }
 	}
     }
 }
 
 static void checkForMupit(struct sqlConnection *conn, struct trackDb *tdb, int start)
 /* Print a link to MuPIT if the item is in the mupitRanges table */
 {
 if (sqlTableExists(conn, "mupitRanges"))
     {
-    char *doLink = NULL;
-    char query[512];
-    sqlSafef(query, sizeof(query),
-        "select * from mupitRanges where chrom='%s' and chromStart <= %d and chromEnd >= %d",
-        seqName, start, start);
-    doLink = sqlQuickString(conn, query);
-    if (doLink != NULL)
+    struct sqlResult *sr = hRangeQuery(conn, "mupitRanges", seqName, start, start+1, NULL, NULL);
+    char **row = NULL;
+    if ((row = sqlNextRow(sr)) != NULL)
         {
         int mupitPosition = start + 1; // mupit uses 1-based coords
         printf("<TR><TD colspan=2><B>");
         if (sameString(database, "hg19"))
             printf("<A HREF=\"http://hg19.cravat.us/MuPIT_Interactive/?gm=%s:%d\">", seqName, mupitPosition);
         else if (sameString(database, "hg38"))
             printf("<A HREF=\"http://mupit.icm.jhu.edu/MuPIT_Interactive/?gm=%s:%d\">", seqName, mupitPosition);
         printf("MuPIT Structure</A></B></TD></TR>\n");
         }
     }
 }
 
 void printOtherSnpMappings(char *table, char *name, int start,
 			   struct sqlConnection *conn, int rowOffset)
 /* If this SNP (from any bed4+ table) is not uniquely mapped, print the other mappings. */