95807c7178fd38d52564f06df9fd5b90ceca1d24
braney
Wed Sep 2 11:20:44 2026 -0700
hgTracks, hgc, hgPhyloPlace: small fixes from the v503 Preview II review, refs #38172
hgTracks.c: skipBeyondDelimit returns NULL when the delimiter is absent, and
the caller decremented and printed it without checking. The noYearDbs list
keeps every assembly that reaches it carrying a '(' today, so nothing shows,
but printf used to print "(null)" where htmlEncode now walks off the end.
Fall back to the whole freeze name.
gtexTracks.c: the guard before the in place truncation was two bytes stricter
than the buffer needs, so a description just over the budget printed in full.
Say what the buffer requirement actually is. vcfTrack.c has the same shape a
byte the other way and is already right.
hgPhyloPlace.c: initialize size, as the two sibling call sites do.
cgiMemBlobFind always sets it when it returns a block, so this is for
consistency.
bigBedClick.c: hubEncode was called twice on the same string in one
statement.
diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 0975fd8b437..abe170effbb 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -9735,31 +9735,34 @@
freezeName = hFreezeFromDb(database);
if(freezeName == NULL)
freezeName = "Unknown";
hPrintf("<span id='assemblyName' style='font-size:large;'><B>");
// for these assemblies, we do not display the year, to save space and reduce clutter
// Their names must include a "(" character
char* noYearDbs[] = { "hg19", "hg38", "mm39", "mm10" };
// on an assembly hub the organism, the freezeName (the hub's genome description) and the
// db name are all supplied by the hub, so escape them before they go in the page
if ( stringArrayIx(database, noYearDbs, ArraySize(noYearDbs)) != -1 )
{
// freezeName is e.g. "Feb. 2009 (GRCh37/hg19)"
char *afterParen = skipBeyondDelimit(freezeName, '(');
- afterParen--; // move back one char
+ if (afterParen != NULL)
+ afterParen--; // move back one char, onto the '(' itself
+ else
+ afterParen = freezeName; // no '(' in the description, so print it whole
hPrintf("%s %s on %s %s", organization, browserName, htmlEncode(organism),
htmlEncode(afterParen));
}
else if (startsWith("zoo",database) )
{
hPrintf("%s %s on %s June 2002 Assembly %s target1",
organization, browserName, htmlEncode(organism), htmlEncode(freezeName));
}
else
{
if (sameString(organism, "Archaea"))
{
hPrintf("%s %s on Archaeon %s Assembly",
organization, browserName, htmlEncode(freezeName));
}