src/hg/hgTracks/wigTrack.c 1.102

1.102 2010/03/30 21:44:53 hiram
Fix one last place where long strings in custom tracks cause problems
Index: src/hg/hgTracks/wigTrack.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/wigTrack.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -b -B -U 4 -r1.101 -r1.102
--- src/hg/hgTracks/wigTrack.c	4 Jan 2010 19:12:26 -0000	1.101
+++ src/hg/hgTracks/wigTrack.c	30 Mar 2010 21:44:53 -0000	1.102
@@ -20,8 +20,9 @@
 
 static char const rcsid[] = "$Id$";
 
 #define SMALLBUF 128
+#define LARGEBUF 256
 
 struct wigItem
 /* A wig track item. */
     {
@@ -270,9 +271,9 @@
     struct wiggle *wiggle, struct hash *spans)
 /* copy values from *wiggle to *wi, maintain trackSpans hash	*/
 {
 static char *previousFileName = (char *)NULL;
-char spanName[128];
+char spanName[SMALLBUF];
 struct hashEl *el;
 char *trackName = tg->mapName;
 
 /*	Allocate trackSpans one time only, for all tracks	*/
@@ -1020,10 +1021,10 @@
 #ifndef GBROWSE
     if (tg->customPt)
 	{
 	struct customTrack *ct = tg->customPt;
-	itemName = (char *)needMem(128 * sizeof(char));
-	safef(itemName, 128, "%s %s", ct->wigFile, tg->mapName);
+	itemName = (char *)needMem(LARGEBUF * sizeof(char));
+	safef(itemName, LARGEBUF, "%s %s", ct->wigFile, tg->mapName);
 	}
     else
 #endif /* GBROWSE */
 	itemName = cloneString(tg->mapName);
@@ -1350,10 +1351,10 @@
 	{
 	boolean zeroOK = TRUE;
 	double graphUpperLimit = tg->graphUpperLimit;
 	double graphLowerLimit = tg->graphLowerLimit;
-	char upper[128];
-	char lower[128];
+	char upper[SMALLBUF];
+	char lower[SMALLBUF];
 	char upperTic = '-';	/* as close as we can get with ASCII */
 			/* the ideal here would be to draw tic marks in
  			 * exactly the correct location.
 			 */