980d5c9094718ca4289c67e15de35c82c367f6e8
larrym
  Tue Jan 17 15:06:48 2012 -0800
fix off-by-one error in tagEncode
diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index e1b9fc4..42c747e 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -2212,31 +2212,31 @@
 char objVal[5];
 safef(objName, sizeof(objName), "%s_sel", subtrack->track);
 safef(objVal, sizeof(objVal), "%d", fourState);
 cartSetString(cart, objName, objVal);
 tdbExtrasFourStateSet(subtrack,fourState);
 }
 
 
 static char *tagEncode(char *name)
 // Turns out css classes cannot begin with a number.  So prepend 'A'
 // If this were more widely used, could move to cheapcgi.c.
 {
 if (!isdigit(*name))
      return name;
 
-char *newName = needMem(strlen(name)+1);
+char *newName = needMem(strlen(name)+2);
 *newName = 'A';
 strcpy(newName+1,name);
 return newName;
 }
 
 typedef struct _dimensions {
     int count;
     char**names;
     char**subgroups;
     char* setting;
 } dimensions_t;
 
 boolean dimensionsExist(struct trackDb *parentTdb)
 /* Does this parent track contain dimensions? */
 {