e81403a315a24af601884b8a19e89bcecc92f267
galt
  Sat Dec 8 20:04:28 2018 -0800
Fixing hFindSplitTable and its use. Standard size, give real string size so no undetected overflows. Test result and abort if not found. Avoids SQL errors that otherwise will popup. Handles uninitialzed stack better for the output name. refs #22596.

diff --git src/hg/inc/hdb.h src/hg/inc/hdb.h
index e703eb3..06f7188 100644
--- src/hg/inc/hdb.h
+++ src/hg/inc/hdb.h
@@ -580,33 +580,37 @@
 
 boolean hHasField(char *db, char *table, char *field);
 /* Return TRUE if table has field */
 
 boolean hFieldHasIndex(char *db, char *table, char *field);
 /* Return TRUE if a SQL index exists for table.field. */
 
 boolean hFindFieldsAndBin(char *db, char *table,
 	char retChrom[HDB_MAX_FIELD_STRING],
 	char retStart[HDB_MAX_FIELD_STRING],
 	char retEnd[HDB_MAX_FIELD_STRING], boolean *retBinned);
 /* Given a table return the fields for selecting chromosome, start, end,
  * and whether it's binned . */
 
 boolean hFindSplitTable(char *db, char *chrom, char *rootName,
-	char retTableBuf[HDB_MAX_TABLE_STRING], boolean *hasBin);
-/* Find name of table that may or may not be split across chromosomes.
- * Return FALSE if table doesn't exist.  */
+	char *retTableBuf, int tableBufSize, boolean *hasBin);
+/* Find name of table in a given database that may or may not
+ * be split across chromosomes. Return FALSE if table doesn't exist. 
+ *
+ * Do not ignore the return value. 
+ * This function does NOT tell you whether or not the table is split. 
+ * It tells you if the table exists. */
 
 struct slName *hSplitTableNames(char *db, char *rootName);
 /* Return a list of all split tables for rootName, or of just rootName if not
  * split, or NULL if no such tables exist. */
 
 int hBinLevels(void);
 /* Return number of levels to bins. */
 
 int hBinFirstShift(void);
 /* Return amount to shift a number to get to finest bin. */
 
 int hBinNextShift(void);
 /* Return amount to shift a numbe to get to next coarser bin. */
 
 int hFindBin(int start, int end);